         << LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION >>     00000001
<<                                                               >>     00005000
                                                                        00010000
                                                                        00015000
                                                                        00020000
<<                         INCLIOQ5                              >>     00025000
                                                                        00030000
                                                                        00035000
<<===============================================================>>     00040000
<<                                                               >>     00045000
<<              ===         OOOOO       QQQQQ       V       V    >>     00050000
<<               I          O   O       Q   Q        V     V     >>     00055000
<<               I          O   O       Q  QQ         V   V      >>     00060000
<<              ===         OOOOO       QQQQQQ         V V       >>     00065000
<<                                           Q          V        >>     00070000
<<===============================================================>>     00075000
                                                                        00080000
                                                                        00085000
                                                                        00090000
$IF X8 = OFF                                                            00095000
$CONTROL NOLIST                                                         00100000
$IF                                                                     00105000
COMMENT                                                                 00110000
                                                                        00115000
                       I/O QUEUE ELEMENT (IOQ)                          00120000
                       -----------------------                          00125000
                                                                        00130000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00135000
  |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                     00140000
  |        REQUEST DEPENDENT FLAGS                |                     00145000
 0|                                               |  QFLAG              00150000
  |-----------------------------------------------|                     00155000
 1|                  IOQ POINTER                  |  QLINK              00160000
  |-----------------------------------------------|                     00165000
 2|                    QLDEVN                     |  QLDEV              00170000
  |-----------------------------------------------|                     00175000
 3|                 MISCELLANEOUS                 |  QMISC              00180000
  |-----------------------------------------------|                     00185000
 4|S |         DATA SEGMENT DST NUMBER            |  QDSTN S(Word 4(0:1)00190000
  |                                               |  Stackflag  If set  00195000
  |-----------------------------------------------|  QADDR is DB rel.   00200000
  |                                               |                     00205000
 5|                    ADDRESS                    |  QADDR              00210000
  |-----------------------------------------------|                     00215000
 6|         UNIT          |       FUNCTION        |  QFUNC              00220000
  |-----------------------------------------------|                     00225000
 7|          COUNT/XLOG/CONTROL RETURNS           |  QWBCT              00230000
  |-----------------------------------------------|                     00235000
 8|                      P1                       |  QPAR1              00240000
  |-----------------------------------------------|                     00245000
 9|                      P2                       |  QPAR2              00250000
  |-----------------------------------------------|                     00255000
10|///////////////////////|  QUALIFIER   | STATUS |  QSTAT              00260000
  |-----------------------------------------------|                     00265000
11|                     PCBN                      |  QPCBN              00270000
  |-----------------------------------------------|                     00275000
QFLAG - Request dependent flags                                         00280000
Bit 0     .ABORT        Request has been aborted externally.            00285000
                                                                        00290000
Bit 1     .SPECIAL      Special handling is to be applied to this       00295000
                        request.  For disc, indicates a memory          00300000
                        management request.                             00305000
                                                                        00310000
Bit 2     .DIAG         Diagnostic request (not used).                  00315000
                                                                        00320000
Bit 3     .SBUF         System Buffer. Target is a system buffer        00325000
                        whose index is relative to the start of         00330000
                        the SBUF table.                                 00335000
                                                                        00340000
Bit 4     .IOWAKE       Wake caller on completion of request.           00345000
                                                                        00350000
Bit 5     .BLOCKED      Blocked I/O.  Caller is waited in ATTACHIO until00355000
                        request is completed.                           00360000
                                                                        00365000
Bit 6     .COMPLETED    Request has been completed and caller woken if  00370000
                        he had specified.                               00375000
I/O QUEUE ELEMENT (CONT.)                                               00380000
-----------------                                                       00385000
                                                                        00390000
                                                                        00395000
Bit 7     .DATAFRZN     Data segment has been made present and is       00400000
                        frozen.                                         00405000
                                                                        00410000
Bit 8     .MAMERRORD    MAM error on data segment make present.         00415000
                                                                        00420000
Bit 9     .PREQ         This request has been started but was preempted 00425000
                        by a MAM request.                               00430000
                                                                        00435000
Bit 10    .SFAIL        Start SIO failure in GIP.                       00440000
                                                                        00445000
Bit 11    .PFAIL        The I/O has been aborted because of a powerfail.00450000
                                                                        00455000
Bits12-13 .PREMPT       Premptive type code:  1-soft, 2-hard.           00460000
                                                                        00465000
Bit 15    .MSGDONE      A message request reply has completed.          00470000
QLINK - SYSDB relative pointer to next IOQ element.  Points to first    00475000
        word of element.                                                00480000
QLDEV - Logical Device Number                                           00485000
QMISC - Device dependent.                                               00490000
                                                                        00495000
QDSTN - If SYSBUFRs is clear then this is the DST number of the target  00500000
        data segment.If bit 0 is set then buffer address is a DB offset 00505000
        value instead of segment relative offset (implemented for       00510000
        NOWAIT IO and NOBUFF).                                          00515000
QADDR - Offset in data segment or sys buff table to target data buffer. 00520000
QFUNC.FUNC - Function code and qualifiers as specified by driver.       00525000
QWBCT - On initiation specifies the word count if positive or byte      00530000
        count if negative.  At completion of the request this location  00535000
        contains the actual transmission count in the same units as the 00540000
        call.  Certain control requests return data through this        00545000
        location.                                                       00550000
QPAR1 - Parameter one, defined by driver                                00555000
QPAR2 - Parameter two, defined by driver                                00560000
QMISC - Miscellaneous request dependent storage available to driver.    00565000
QSTAT.PCBN - PCB Number of process which made this request.  Zero if    00570000
             not associated with any process and IOQ is to be returned  00575000
             by the system.                                             00580000
     .QUALIFIER - A code which further defies or qualifies the          00585000
                  general status.  Defined by driver.                   00590000
     .STATUS - General Status.  Indicates current and result state of   00595000
               the request according to the following codes.            00600000
                0 - not started or awaiting completion.                 00605000
                1 - successful completion.                              00610000
                2 - end of file detected.                               00615000
                3 - unusual condition.                                  00620000
                4 - irrecoverable error.                                00625000
;                                                                       00630000
$CONTROL LIST                                                           00635000
<<   TO PEG THIS SET OF DECLARATIONS THE PROCEDURE MUST HAVE   >>       00640000
<<   THE USER MUST HAVE A LOGICAL VARIABLE:  IOQ'ENTRY'INDEX   >>       00645000
<<   WHICH IS ASSIGNED THE   VALUE OF THE WORD INDEX OF THE     >>      00650000
<<   OF THE DESIRED IOQ.                                       >>       00655000
<<   EG     IOQ'ENTRY'INDEX := MY'IOQ'S'TABLE'WORD'INDEX       >>       00660000
                                                                        00665000
                                                                        00670000
LOGICAL POINTER IOQ = %5;     << SYSTEM TABLE DEFINITION FOR IOQ >>     00675000
                                                                        00680000
                                                                        00685000
EQUATE                                                                  00690000
                                                                        00695000
    IOQ'FLAGS'INDEX   =  0,                                             00700000
    IOQ'QLINK'INDEX   =  1,                                             00705000
    IOQ'LDEV'INDEX    =  2,                                             00710000
    IOQ'QMISC'INDEX   =  3,                                             00715000
    IOQ'BUFDST'INDEX  =  4,                                             00720000
    IOQ'BUFADR'INDEX  =  5,                                             00725000
    IOQ'FUNC'INDEX    =  6,                                             00730000
    IOQ'COUNT'INDEX   =  7,                                             00735000
    IOQ'PARM1'INDEX   =  8,                                             00740000
    IOQ'PARM2'INDEX   =  9,                                             00745000
    IOQ'STATUS'INDEX  =  10,                                            00750000
    IOQ'PCB'INDEX     =  11;                                            00755000
                                                                        00760000
                                                                        00765000
                                                                        00770000
DEFINE                                                                  00775000
                                                                        00780000
    IOQ'FLAGS   =   IOQ(IOQ'FLAGS'INDEX+IOQ'ENTRY'INDEX)#,              00785000
    IOQ'QLINK   =   IOQ(IOQ'QLINK'INDEX+IOQ'ENTRY'INDEX)#,              00790000
    IOQ'LDEV    =   IOQ(IOQ'LDEV'INDEX+IOQ'ENTRY'INDEX)#,               00795000
    IOQ'QMISC   =   IOQ(IOQ'QMISC'INDEX+IOQ'ENTRY'INDEX)#,              00800000
    IOQ'BUFDST  =   IOQ(IOQ'BUFDST'INDEX+IOQ'ENTRY'INDEX)#,             00805000
    IOQ'BUFADR  =   IOQ(IOQ'BUFADR'INDEX+IOQ'ENTRY'INDEX)#,             00810000
    IOQ'UNITFNC =   IOQ(IOQ'FUNC'INDEX+IOQ'ENTRY'INDEX)#,               00815000
    IOQ'COUNT   =   IOQ(IOQ'COUNT'INDEX+IOQ'ENTRY'INDEX)#,              00820000
    IOQ'PARM1   =   IOQ(IOQ'PARM1'INDEX+IOQ'ENTRY'INDEX)#,              00825000
    IOQ'PARM2   =   IOQ(IOQ'PARM2'INDEX+IOQ'ENTRY'INDEX)#,              00830000
    IOQ'STAT    =   IOQ(IOQ'STATUS'INDEX+IOQ'ENTRY'INDEX)#,             00835000
    IOQ'PCB     =   IOQ(IOQ'PCB'INDEX+IOQ'ENTRY'INDEX)#;                00840000
                                                                        00845000
                                                                        00850000
                                                                        00855000
DEFINE                                                                  00860000
                                                                        00865000
    IOQ'DBREL   =   IOQ'BUFDST.(0:1)#,    << 1 => IO IS DB REL. >>      00870000
    IOQ'BUF'DSTN=   IOQ'BUFDST.(1:15)#,   <<  DST NUMBER ONLY   >>      00875000
    IOQ'UNIT    =   IOQ'UNITFNC.(0:8)#,   << UNIT # ON CONTROLLER >>    00880000
    IOQ'FUNC    =   IOQ'UNITFNC.(8:8)#,   << FUNCTION REQUESTED  >>     00885000
                                                                        00890000
                                                                        00895000
    IOQ'ABORT   =   IOQ'FLAGS.(0:1)#,     << IOQ IS TO BE ABORTED >>    00900000
    IOQ'SPECIAL =   IOQ'FLAGS.(1:1)#,     << A SPECIAL REQUEST >>       00905000
    IOQ'DIAG    =   IOQ'FLAGS.(2:1)#,     << A DIAGNOSTIC REQUEST >>    00910000
    IOQ'SBUF    =   IOQ'FLAGS.(3:1)#,     << REQ USES SBUFS  >>         00915000
    IOQ'IOWAKE  =   IOQ'FLAGS.(4:1)#,     << WAKE CALLER WHEN DONE >>   00920000
    IOQ'BLOCKED =   IOQ'FLAGS.(5:1)#,     << REQ WAITED IN ATTACHIO>>   00925000
    IOQ'DONE    =   IOQ'FLAGS.(6:1)#,     << REQ IS DONE  >>            00930000
    IOQ'DATAFRZN=   IOQ'FLAGS.(7:1)#,     << DATA IS FROZEN IN MEM >>   00935000
    IOQ'MAMERR  =   IOQ'FLAGS.(8:1)#,     << MAKE PRESENT ERROR >>      00940000
    IOQ'PREQ    =   IOQ'FLAGS.(9:1)#,     << REQ WAS PREEMPTED  >>      00945000
    IOQ'SFAIL   =   IOQ'FLAGS.(10:1)#,    << START IO FAILED   >>       00950000
    IOQ'PFAIL   =   IOQ'FLAGS.(11:1)#,    << A POWERFAIL OCCURED >>     00955000
    IOQ'PREMPT  =   IOQ'FLAGS.(12:2)#,    << 1=SOFT  2=HARD PREEMPT >>  00960000
    IOQ'MSGDONE =   IOQ'FLAGS.(15:1)#,    << MESSAGE HAS COMPLETED >>   00965000
    IOQ'ON'FREELIST=IOQ'PCB.(0:1)#;       << 1 MEANS ON FREE LIST  >>   00970000
