SCSI INTERFACE MODULE (SIM)
SPECIFICATION
REVISION 1.0
JUNE 1, 1989
EDITORS:
JERRY ARMSTRONG - NCR CORPORATION
AND
SHISHIR SHAH - WESTERN DIGITAL
1. Purpose
The purpose of this document is to fully define the interface to the
SCSI Interface Module (SIM). This includes the structure definitions,
the functions provided, the initialization procedure, and interrupt
processing algorithms. This document defines an Operating System
independent interface to the SCSI SIM module.
1.1 Overview
This document is divided into four sections.
- structure definitions
- function definitions
- initialization algorithm
- interrupt (hardware) processing
The structure definitions section defines the structures used when
accessing the SCSI Interface Module.
The function definitions section details the functionality provided by
the SIM software. The individual functions are described as well as the
fields utilized within the appropriate structures.
The section on Initialization describes the interface used to initialize
the SIM software.
The section on Interrupt handling outlines the hardware interrupt
processing interface and time-out condition handling.
1.2 Introduction
The CAM Layer is a system service which provides generic SCSI
functionality. The basic idea is to be able to send arbitrary SCSI
command descriptor blocks (CDBs) and selected messages. There is CAM
Layer software associated with each SCSI Host Bus Adapter (HBA). It is
invoked by passing a pointer to a standardized data structure to the CAM
Layer software. This section describes the services provided by the CAM
Layer software for each SCSI HBA. Rudimentary coordination of multiple
SCSI HBAs is also supported in the CAM structure.
There will be features which are mandatory across all Operating System
implementations and they are presented first. Features which are
optional for certain Operating Systems are presented next. Finally,
features which are optional for all Operating Systems are presented.
Every implementation must allow the sending of SCSI CDBs. The SCSI CDB
is contained in the CAM Command Block whose address is passed to the CAM
Layer.
2. Structures
2.1 SIM Software Header
Table 2-1 defines the header of the SIM software module. This definition
allows SIM software to be resident in ROM*, as ROM BIOS code. It does
not prevent the SIM software from residing in RAM.
TABLE 2-1: SIM SOFTWARE HEADER ENTRIES
=======================================================================
Field Offset Length
Reserved for other (ROM*) BIOS 16
Signature SCSI-SIM SOFTWARE = 06A6A6A6Ah 4
Memory Requirement for Initialization Routine 2
Initialization Entry SCSI-SIM Software ?
=======================================================================
*BIOS ported in ROM for ATR & ATR Clones, PS/2R & PS/2R Clones type
machines.
(R Registered trademark of International Business Machines Corporation)
- Signature SCSI-SIM Software = 06A6A6A6Ah: This field validates the SCSI-
SIM software module.
- Memory Requirement for Initialization Routine: This field indicates
memory allocation (in bytes) required at initialization time.
- Initialization Entry SCSI-SIM Software: This field is the initialization
entry point of the SIM software. It may contain a 'JMP' (or similar
instruction) to SCSI-SIM software Initialization routine.
2.2 SIM Command Block
This section defines the SIM Command Block and the fields contained
within this structure. Following the structure definition is a detailed
description of each field within the SIM Command Block.
TABLE 2-2: SIM COMMAND BLOCK
========================================================================
FIELD OFFSET LENGTH
Public Data
Function Code 1
Function Flags 1
Path 1
Target ID 1
Target LUN 1
SIM Status Code 1
SCSI Status 1
CDB Length 1
SCSI Command Descriptor Block 16
Data Buffer Pointer 4
Data Buffer Length 4
Sense Data Buffer Pointer 4
Sense Data Allocation Length 2
Priority / Ordering / ? 2
Timeout Value 4
Next CCB Pointer 4
Private Data
Scratchpad Area ?
========================================================================
- Function Code: This field specifies the actual function which is
being requested. If a restricted version of the CAM Layer is
wanted, the legal function codes can be filtered to prevent
unwanted access to dangerous functions.
TABLE 2-3: SIM FUNCTION CODES
========================================================================
FUNCTION CODE
send SCSI command to specified target. 0
initiate SCSI ABORT message. 1
initiate SCSI Bus Device Reset. 2
return Host adapter SCSI ID. 3
get device table information. 4
handle interrupt 5
timer expired 6
abort SCB 7
initialize SIM device block 8
allow target mode. 9
get SCSI CDB. 10
receive data. 11
send data. 12
disconnect. 13
reselect. 14
send status. 15
send message. 16
initialize Host Bus Adapter 17
SCSI Bus Reset (NOT recommended!) 18
RESERVED. 19-255
========================================================================
- Function Flags: This field contains flags that are used to indicate
special handling of the requested function. These bits are defined
as follows:
Bit 0 = direction flag - This bit is an indicator that tells the
generic driver the direction of data movement during the data
transfer phase. A value of zero (0) indicates a "read" operation
(data from target to initiator). A value of one (1) indicates a
"write" operation (data from initiator to target).
Bit 1 = polling flag - When set to one, this bit causes the driver
to return to the caller as soon as the command block has been
"registered" with the driver. This will allow the calling software
to "poll" the driver return code field to determine when the
command is completed. A non-zero value will indicate completion or
termination. When this bit is reset (0), the driver will suspend
the caller until the command is completed.
Bit 2 = physical address bit - When set to one, this bit indicates
that the physical address fields in the CAM Command Block are
valid.
Bit 3 = logical address bit - When set to one, this bit indicates
that the logical address fields in the CAM Command Block are valid.
Bit 4 = scatter/gather enable bit - When set to one, this bit
allows the CAM driver to perform scatter/gather operations on this
command.
Bit 5 = auto sense flag - When set to one, this bit causes the
driver to retrieve sense data on a check condition in the target
completion status byte. When the check condition occurs, the driver
constructs a 6-byte SCSI CDB with the "Request Sense" command to
send to the same target. The location and amount of the sense data
is as specified in the command block. On return, the driver return
code field contains the status of the original command. The target
status contains the target completion status of the original
command. (This feature should be mandatory! This would eliminate
the need for this bit.)
Bit 6 = disconnect flag - When set to one, this bit causes the
driver to set bit 6 in the SCSI IDENTIFY message to one. Bit 6 in
the SCSI IDENTIFY message indicates that the initiator has the
ability to accommodate disconnection and reconnection. If this
feature is made mandatory, it would eliminate the need for this
bit.
Bit 7 = RESERVED
- Path: This field contains the logical link number of the SCSI link on
which this command is to operate. Link numbers are zero-based so
that the first link supported by the CAM Layer is link number zero.
Link numbers are successively numbered up to the number of links
supported without any gaps in the numbers.
- Target ID and Target LUN: These fields contains the SCSI ID and
Logical Unit Number (LUN) of the target for this command.
- SCSI Status: This field is the status byte returned by the target
after the command is completed.
- CDB Length: This field contains the length, in bytes, of the CDB
contained in the SCSI Command Descriptor Block field. The value
contained in this field must be between 6 and 12.
- SCSI Command Descriptor Block: This 12-byte field will contain the
CDB for the command that is to be performed.
- Data Buffer Pointer: This field contain a pointer to the data buffer
used in connection with this request.
- Data Buffer Length: This field contains the length (in bytes) of the
data buffer or the length of the scatter/gather list, if the
scatter/gather enable bit is set.
- Sense Data Buffer Pointer: This field contains a pointer to the data
buffer for the "request sense" data. This buffer (and pointer) will
only be used if the sense data control bit is set and a "check
condition" occurs while performing the specified command.
- Sense Data Allocation length: This field contains the length (in
bytes) of the request sense data buffer.
- Priority / Ordering / ?: This field is used to allow the driver
software to specify the relative priority and/or ordering of this
request in relation to the other requests pending at the CAM Layer.
- Timeout Value: This field is used to specify the number of
milliseconds that this SCB must wait until continuing this request
or the maximum amount of time that this SCB should take to
complete.
- Next CCB Pointer: This field provides a pointer to the next command
block in a chain of command blocks. A value of zero (0) in this
field indicates the last command block on the chain. These fields
allow for linked commands.
- Scratchpad Area: This field is used by the CAM Layer to store
temporary data while it processes this request.
- SIM Status Code: This field contains the CAM Layer driver's returned
status code. The values returned have the following meanings:
00 = NOT USED - command in progress or still queued.
01 = NO ERRORS - normal completion status.
02 = BUFFER OVERFLOW ERROR - Either the target asked for more than
12 bytes of command, or the target tried to send or receive
more bytes of data than the buffer can hold.
03 = WAITING ON INTERRUPT - The command has been issued to the
hardware and the SIM software is waiting for a hardware
interrupt to complete the command.
04 = SCB QUEUED - The SIM software has queued this command on his
internal queue.
05 = WAIT FOR TIMEOUT - The SIM software must be called again after
the returned amount of time has expired.
06-7F = RESERVED.
80 = COMMAND TIMEOUT - the specified command did not complete
within the timer value specified.
81 = SCSI BUS BUSY - The SIM software failed to win arbitration for
the SCSI Bus during several different bus free phases.
82 = TARGET SELECTION TIMEOUT - The target failed to respond to
selection.
83 = SCSI BUS RESET SENT/RECEIVED - The SCSI operation was
terminated at some point because the SCSI bus was reset.
84 = UNEXPECTED DISCONNECTION/INVALID BUS PHASE - The target
terminates a SCSI operation prematurely by releasing the SCSI
bus. The target does this by dropping the BSY signal prior to
sending a "Command Complete" or "Disconnect" message.
85 = TRANSFER INCOMPLETE - This code indicates that the SCSI
operation ended normally, but the total number of bytes
transferred successfully was less than the initial number of
bytes to be transferred.
86 = UNCORRECTABLE PARITY ERROR DETECTED - This code indicates that
an uncorrectable SCSI bus parity error was detected. When this
occurs, the CAM Layer driver sends the ABORT message to the
target.
87 = SENSE DATA OPERATION FAILED - The SIM software attempted to
obtain sense data and failed.
88 = MESSAGE REJECT RECEIVED - This code is returned when the SIM
software receives the MESSAGE REJECT message.
89 = BAD COMMAND - This code is returned when an invalid command
code is specified.
8A = INVALID BUS PHASE - This code is returned when an invalid bus
phase is detected on the SCSI link.
8B = INVALID LINK NUMBER - This code is returned when an invalid
SCSI link number is specified.
8C-8F = RESERVED.
90 = TARGET SELECTED - This code is returned when the SCSI HBA has
been selected by an initiator.
91 = CDB RECEIVED - This code is returned along with the CDB sent
by the initiator to indicate that the CDB has been
successfully received.
92-FF = RESERVED.
2.3 SIM Device Block
SIM Device Block is the area in RAM used by the SIM software to store its
local variables and other information. Since, memory allocation varies from
OS to OS, SIM Device Block is allocated by the Device Driver OR Transport
Module at initialization time. Please see "Initialization" for more
information.
Public Data is READ ONLY data except for SCSI SIM software.
Private data is for the use of SCSI SIM software only. SIM software may use
this area for local variables, bookkeeping, etc.
TABLE 2-4: SIM DEVICE BLOCK
==========================================================================
Field Offset Length
Public Data
Length 2
Virtual Address of SIM Device Block 4
Physical Address of SIM Device Block 4
Vendor ID 16
Product ID 16
Product Revision 4
Common Port Pairs 4
Exclusive Port Pairs 4
Logical ID 1
Hardware Interrupt Level 1
Private Data ?
==========================================================================
- Length: This value contains the length, in bytes, of the SIM Device
Block.
- Virtual Address: This field indicates the virtual address of SIM Device
Block. The format of this address may vary form one hardware platform to
another.
- Physical Address: This field is the physical address of the SIM Device
Block. The format of this address is the same as that of SCSI.
Byte 0 Most significant byte.
Byte 3 Least significant byte.
- Vendor ID: This ASCII field identifies the vendor.
- Product ID: This ASCII field identifies the name of the product.
- Product Revision: This field indicates revision of SCSI-SIM software.
- Common Port Pairs: This is a range of common I/O Port Pairs
used by the SIM. The first word of the doubleword is the
starting I/O port number of a range of I/O port numbers. The
second word is ending port number of the range. SIM shares the
I/O ports indicated in the range.
- Exclusive Port Pairs: This is a range of exclusive I/O Port
Pairs used by the SIM. The first word of the doubleword is the
starting I/O port number of a range of I/O port numbers.
Second word is ending port number of the range. SIM does not
share the I/O port indicated in this range.
- Logical ID: This field indicates the Logical ID of the SIM Device Block.
When the SCB for a particular adapter is passed, it is important to pass
the SIM Device Block related to this adapter (because one SIM can be
capable of operating multiple adapters).
- Hardware Interrupt Level: This field indicates the hardware interrupt
level of the adapter operated by this SIM Device Block.
- Private Data: This area is dedicated to SIM software specific data. It is
a private RAM area provided for the use of SCSI-SIM software, where it
can store its local variables. Format may vary from one implementation to
another.
2.4 Interrupt Process Block
Pointer to Interrupt Process Block is passed in the SCB. When SCB function
code = "Handle Interrupt", data buffer pointer in SCB points to the
Interrupt Process Block.
Interrupt Process Block is defined to provide efficient interrupt handling.
As a rule of thumb, minimum time should be spent during hardware interrupt
processing. Since, in multi tasking (multi threading) environment more than
one SCB can be active at SIM layer, only one call to the SIM software needed
to process hardware interrupt. Status word in the Interrupt Process Block
returns the information about this hardware interrupt.
TABLE 2-5: INTERRUPT PROCESS BLOCK
==========================================================================
Offset Length
Status 2
Address of routine to CAll for more Service 4
Resource to be Requested 1
Resource Parameter (requested) 1
Resource to be Released 1
Resource Parameters (released) 1
Number of SCBs Completed 2
Pointer to SCB Associated with this Interrupt 4
==========================================================================
- Status: This field indicates the status of the interrupt. Initial value
must be set to 0FFFFh.
Bit
16-6 reserved
5 = 1 Unsolicited message from SCSI
4 = 1 Resource allocation field valid
3 = 1 Resource release field valid
2 = 1 Routine address is valid
1 = 1 SCB address is valid
0 = 1 Interrupt of Adapter serviced by SIM software is valid
- Resource to be Allocated: This byte indicates the resource to be
allocated (eg, DMA channel). Please note that resource requirement
may vary from one hardware platform to another.
- Resource to be Released: This byte indicates the resource to be
released.
- Resource parameters: Resource parameters may vary with different
hardware platforms. For each hardware platform type of resources and
parameters need to be defined.
TABLE 2-6: TYPE OF RESOURCES
==============================================================================
1 = DMA.
Other values reserved.
==============================================================================
Other values are reserved OR TBD at this time. Please note that resource
requirement may vary from one hardware platform to another.
2.5 Initialization Table
The Initialization Table is created at initialization time by the SIM
software. SIM passes the contents of Table 2-7.
TABLE 2-7: INITIALIZATION TABLE
==========================================================================
Field offset length
Length 2
Number of logical IDs 1
reserved 1
SIM Device Block Length 2
SIM Command Block Length 2
Offset of Start Routine 2
Vendor ID 16
Product ID 16
Revision 4
Number of Targets Present, Logical ID 1 1
Array of Bit Mask of LUNs on Targets, Logical ID 1 8
: : : : : : : : : : : : : : : :
Number of Targets Present, Logical ID n 1
Array of Bit Mask of LUNs on Targets, Logical ID n 8
Length of Hardware Interrupt Level Array 1
Hardware Interrupt Level Array n
Reserved/Private Use - No of Bytes 1
- Area n
==========================================================================
- Number of Logical IDs: This value indicates the maximum number of
devices (adapters) that require individual SIM Device Blocks but are
operated by the same SIM software module.
- Hardware Interrupt Level: This field contains the hardware interrupt
level used by the hardware (Adapter).
- SIM Device Block Length: This field contains the length, in bytes, of
memory allocation required for the SIM Device block. It allows better
usage of memory, since SIM software (at Initialization time) may
determine the size of the memory required by looking at the
configuration on SCSI BUS, and/or some other factors.
- SIM Command Block Length: This field contains the length, in bytes,
of memory allocation required for creating the SIM Command Block
(SCB) for the device (HBA). When making a SIM request, any value
equal or greater than is valid.
- Offset, Start Routine: This value is an offset of the SIM software
entry point. Start routine is called to receive service from SIM
software. When start routine is called, all necessary fields in SIM
Command Block (SCB) are provided by the caller.
- Vendor ID: This ASCII field (same as SCSI/2 Vendor ID) identifies the
unique vendor of this Adapter (software/hardware).
- Product ID: This ASCII field identifies the name of a product.
- Revision: This field contains the revision of the SCSI-SIM software.
- Number of Targets Present: This one byte field contains number of
targets present on the SCSI bus with Logical ID n.
- Array of Bit Mask of LUNs on Targets: This is an array containing bit
mask of LUNs present on the targets. Element 0 represents bit mask of
target 0 and so on. Bit 0 of each element of this array indicates the
presence/absence of LUN 0 and so on.
Bit x = 0 LUN x not present.
= 1 LUN x present.
- Length of Hardware Interrupt Level Array: This field contains the
length in bytes of the Hardware Interrupt Level Array.
- Hardware Interrupt Level Array: This array contains the hardware
interrupt level used by different hardware adapter(s) operated by
this SIM Device Block. When the number of Logical IDs is greater than
one, different adapters may share the interrupt level or may operate
on different interrupt levels.
3. SIM Functions
Upon invocation of the SIM Software, the actual function which is being
requested is denoted by the SIM Function Code. If a restricted version
of the SIM Software is desired, the legal function codes can be filtered
to prevent unwanted access to dangerous functions. Any arguments to
these functions or results from these functions will be passed in the
SIM Command Block (SCB) or in buffers pointed to by fields in this
structure. The following paragraphs describe the complete set of SIM
Software functions.
3.1 Send SCSI Command
This function sends the SCSI CDB found in the SIM Command Block to the
specified target on the specified SCSI link. This will be the most often
used function provided by the SIM Software. This is an initiator mode
function.
3.2 Initiate SCSI ABORT Message
This function will issue a SCSI "Abort" message to the specified target
device on the specified SCSI link. This is an initiator mode function.
3.3 Initiate SCSI BUS DEVICE RESET
This function will issue a SCSI "Bus Device Reset" message to the
specified target device on the specified SCSI link. This is an initiator
mode function.
3.4 Return SIM Parameters
This function will return all of the parameters that are used by the
Host Bus Adapter associated with the specified SCSI link. The parameters
will be returned in the area specified by the "Data Buffer Pointer"
field in the SIM Command Block.
3.5 Get Device Table Information
This function will return an array of bytes which are the "peripheral
device type" bytes returned during an INQUIRY command. The first byte of
this array corresponds to the device at SCSI id 0/lun 0. The next byte
is for id 0/lun 1. This continues up to id 7/lun 7. A value of 7F (hex)
indicates that there is no peripheral attached at that id/lun. This
array is returned in the data buffer specified in the SIM Command Block
for the specified SCSI link.
3.6 Handle Interrupt
This function is used to inform the SIM Software that a hardware
interrupt has occurred. See "Interrupt Processing" section for more
details.
3.7 Timer Expired
This function is used to inform the SIM Software that the
amount of time specified in the SCB returned with status code "Wait for
Timeout" has expired.
3.8 Abort SCB
This function is used to cancel a request made to the SIM Software via
the specified SCB. For more information, see the "Abort Condition"
section, below.
3.9 Initialize SIM Device Block
This function is used to initialize the SIM Device Block. Any functions
requested before this function will be terminated with a "Illegal
Request" status code. See the section on "Initialize Device Block" for
more details.
3.10 Allow Target Mode
This function causes the SIM Software to set up the HBA associated with
the specified SCSI link so that it may be selected as a target. The
specified SCSI id must match that returned by the "Return SIM
Parameters" function. The specified lun will be the one that is enabled
for selection. This is a target mode function.
3.11 Get SCSI CDB
This function causes the SIM Software to hold this request until the
specified SCSI id/lun is selected on the specified link. At that point,
it will request the SCSI CDB from the initiator and place it into the
CDB field in the SIM Command Block. This is a target mode function.
3.12 Receive Data
This function causes the SIM Software to request a data out phase to get
data from the current initiator. The data will be placed in the data
buffer. The number of bytes transferred is specified by the data buffer
length field in the SIM Command Block. This is a target mode function.
3.13 Send Data
This function causes the SIM Software to request a data in phase to
transmit data to the current initiator. The data will be transmitted
from the data buffer. The number of bytes transferred is specified by
the data buffer length field in the SIM Command Block. This is a target
mode function.
3.14 Disconnect
This function causes the SIM Software to send a DISCONNECT message to
the current initiator. It then disconnects from the SCSI link. This is a
target mode function.
3.15 Reselect
This function causes the SIM Software to reselect the specified
initiator and send the appropriate IDENTIFY message. This is a target
mode function.
3.16 Send Status
This function causes the SIM Software to send the status byte specified
in the "Target Status" field to the current initiator and then send the
COMMAND COMPLETE message. It will then disconnect from the SCSI link.
This is a target mode function.
3.17 Send Message
This function causes the SIM Software to send the specified message byte(s) to the
current initiator. This is a target mode function.
3.18 Initialize Host Bus Adapter
This function causes the SIM Software to (re)initialize the specified
HBA. All pending commands for that HBA are terminated and all
appropriate initialization is performed. This function might be one of
the commands that a restricted SIM Software might want to disallow.
3.19 SCSI Bus Reset
This function issues a SCSI Bus Reset. This function might be one of the
commands that a restricted SIM Software might want to disallow.
4. Initialization
Following is proposed algorithm for initialization of the SIM software.
This algorithm allows sizes of SCB and SIM Device Block to be determined
at initialization time. Hence, it allows better usage of memory. Again,
this algorithm is general enough to accommodate different Operating
Systems for a given hardware platform.
Initialization is performed in the following sequence:
a) Find SIM software Module.
b) Build Initialization Table.
c) Initialize Device Block.
4.1 Find SIM Software Module
When Operating System initializes Device Driver (OR Transport Module),
SCSI-SIM software initialization is performed as a part of Device Driver
initialization.
Caller (Device Driver / Transport Module) performs a ROM scan looking
for the SIM Signature. Caller may need to make GDT/LDT/Page Table entry
to access ROM.
If not found, Caller requests to load SIM software module and validates
the SIM Signature.
4.2 Build Initialization Table
If SIM Software is present, the Memory Requirement for Initialization
Routine indicates the amount of memory allocation required by SIM
Software to build the Initialization Table. Caller allocates required
memory and calls to the Initialization Entry SIM Software with the stack
setup of Table 4-1.
TABLE 4-1: INITIALIZATION TABLE STACK
==========================================================================
Offset Length
bytes
TOS --> Return Address 4
Pointer to Init Table (to be built) 4
Pointer to Status word 4
NOTE: Status should be initialized to 0FFFFh.
==========================================================================
On Return:
Pointer to Status word: indicates address of status to be updated.
0000h Initialization Table built successfully.
Non zero value indicates an error.
Error codes TBD.
SIM Software builds Initialization Table as indicated in Initialization
Table Structure (Please refer STRUCTURES).
Caller, upon return from this call, may destroy the memory allocated for
Initialization Table.
One of the parameters passed in Initialization Table is offset of the
Start routine. From now on, Caller uses Start routine as entry point in
the SIM software module.
4.3 Initialize Device Block
The Caller requests memory segment (OR page), of size derived from
"Build Initialization Table" call, from Operating System. Then, Caller
builds Virtual address and Physical address for that segment (page), and
initializes the SIM Device Block as indicated in the SIM Device Block
structure (see Structures). The memory allocated for SIM Device Block
should be locked and physical location of this area should never be
changed until next initialization.
Now, Caller calls the Start routine with SCB function code = "Initialize
Device Block" and the stack setup in Table 4-2.
TABLE 4-2: INITIALIZE DEVICE BLOCK STACK
==========================================================================
Offset Length
bytes
TOS ----> Return Address 4
Pointer to SIM Device Block 4
SCB Pointer 4
==========================================================================
The SIM Software initializes the SIM Device Block. SCB status byte
indicates the status of this operation.
On return:
SCB status byte is updated.
00h Initialization completed successfully.
Non zero value indicates failure.
Error codes TBD
5. Interrupt Processing And Timeout Condition
5.1 Interrupt Processing Algorithm
When hardware interrupt (IRQ) occurs, Caller calls the Start routine
with SCB function code = "Handle Interrupt". Data buffer pointer in the
SCB points to Interrupt Process Block. Status word in the Interrupt
Process Block is initialized to 0FFFFh.
Status of interrupt is reported in the Interrupt Process Block. Other
parameters of Interrupt Process Block, number of SCBs associated,
pointers to SCBs related to this interrupt, address of any service
routine to be called for and resource to released or allocated are also
updated.
On return, Caller processes the EOI to Host Interrupt Controller (in
some cases, Operating System processes EOI to the Interrupt controller).
Status of SCB (ptr passed in Interrupt Process Block) indicates the
completion/intermediate status.
If bit 4 (Release resource bit) of status word of Interrupt process
Block is set to 1, Caller releases that resource to Operating System
before calling the SIM routine (address of routine passed in Interrupt
Process Block).
If bit 3 (Allocate resource bit) of status word of Interrupt Process
Block is set to 1, Caller requests that resource from Operating System
before calling the SIM routine (address of routine passed in the
Interrupt Process Block).
If bit 2 of status word of Interrupt Process Block is set to 1 (address
of routine to be called field valid), Caller calls that routine. This
routine may perform error handling OR may start next request in an
internal queue (of the SIM software).
The Start routine is called with the stack setup of Table 5-1.
TABLE 5-1: INTERRUPT PROCESSING ALGORITHM STACK
==========================================================================
Offset Length
bytes
TOS ----> Return Address 4
Pointer to SCSI SIM Device Block 4
Pointer to SCB 4
==========================================================================
5.2 Timeout Condition
When "Timeout" condition occurs, Start routine is called with SCB
function code = "Timeout". Data buffer pointer in the SCB points to the
SCB that timed out.
SCB status byte (SCB ptr passed as parameter in "Timeout SCB") indicates
the status of that request.
It is important that SCB status byte should always be initialized to
0FFh. The Start routine is always called with the stack setup of Table
5-2.
TABLE 5-2: START ROUTINE STACK
==========================================================================
Offset Length
bytes
TOS ----> Return Address 4
Pointer to SCSI SIM Device Block 4
Pointer to SCB 4
==========================================================================
It is CALLER's responsibility to clean up the stack, i.e., remove SIM
Device Block pointer and SCB pointer from the stack.