$PAGE "MPE TABLE ACCESS:  INPUT/OUTPUT DEVICE DIRECTORY (XDD)"          00005000
COMMENT --                                                              00010000
<<**********************************************************>>          00015000
<<*                                                        *>>          00020000
<<*                 INCLXDD - Module I7                    *>>          00025000
<<*                     MPE5 version                       *>>          00030000
<<*                                                        *>>          00035000
<<**********************************************************>>          00040000
                                                                        00045000
$IF X8 = OFF                                                            00050000
$CONTROL NOLIST                                                         00055000
$IF                                                                     00060000
                                                                        00065000
INPUT DEVICE DIRECTORY/OUTPUT DEVICE DIRECTORY                          00070000
----------------------------------------------                          00075000
                                                                        00080000
IDD/ODD (Common attributes referred to as XDD)                          00085000
                                                                        00090000
        IDD:  DST = 45 (= %55)         ODD:  DST = 46 (= %56)           00095000
              SIR =  3                       SIR =  4                   00100000
                                                                        00105000
               Overview of table structure                              00110000
               ---------------------------                              00115000
                                                                        00120000
         +-------------------------------------+                        00125000
         |   Entry 0 (8 words)                 |                        00130000
         | . . . . . . . . . . . . . . . . . . |                        00135000
       2 |   Subentry area pointer             | ---                    00140000
         | . . . . . . . . . . . . . . . . . . |   |                    00145000
         |                                     |   |                    00150000
         +-------------------------------------+   |                    00155000
         |   Head entries (4 words each)       |   |                    00160000
         +-------------------------------------+   |                    00165000
         |   Subentries (%40 words each)       | <--                    00170000
         +-------------------------------------+                        00175000
                                                                        00180000
                                                                        00185000
          Entry 0 (overall table definitions)                           00190000
          -----------------------------------                           00195000
                                                                        00200000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00205000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00210000
 0|      Maximum size     |      Current size     |0 (sectors)          00215000
  +-----------------------+-----------------------+                     00220000
 1|  Head entry size = 4  |  Subentry size = %40  |1 ( words )          00225000
  +-----------------------+-----------------------+                     00230000
 2|   Subentry area pointer (segment relative)    |2                    00235000
  +--+--------------------------------------------+                     00240000
 3|DD|      Next avail device file ID (DFID)      |3                    00245000
  +--+--------------------------------+-----------+                     00250000
 4|///////////////////////////////////|   Fence   |4                    00255000
  +-----------------------------------+-----------+                     00260000
 5|///////////////////////////////////////////////|5                    00265000
  +-----------------------------------------------+                     00270000
 6|///////////////////////////////////////////////|6                    00275000
  +-----------------------------------------------+                     00280000
 7|///////////////////////////////////////////////|7                    00285000
  +-----------------------------------------------+                     00290000
                                                                        00295000
DD:     0 ==> This is the IDD,                                          00300000
        1 ==> This is the ODD.                                          00305000
                                                                        00310000
Fence:  For spooled output devices (ODD), the system-wide out-          00315000
        fence.  For spooled input devices (IDD), the jobfence.          00320000
                                                                        00325000
                                                                        00330000
         Typical head entry (4 words)                                   00335000
         ----------------------------                                   00340000
                                                                        00345000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00350000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00355000
  |    Device outfence    |///////////////////////|                     00360000
  +-----------------------+-----------------------+                     00365000
  |                 Head pointer                  |                     00370000
  +-----------------------------------------------+                     00375000
  |                 Tail pointer                  |                     00380000
  +-----------------------------------------------+                     00385000
  |                Logical device                 |                     00390000
  +-----------------------------------------------+                     00395000
                                                                        00400000
  There are two types of head entry, a class entry and a logi-          00405000
cal device entry. There is only one class entry, and it is the          00410000
first head entry in the XDD.  All  spoofles  opened  by  class          00415000
(e.g.,  LP,  SLOWLP, EPOC, PP, etc.) are linked to this entry.          00420000
There is one logical device entry for each real (physical,  as          00425000
opposed  to virtual) device on the system.  Output devices ap-          00430000
pear in the ODD, input devices in the IDD.  AC/DC devices such          00435000
as terminals appear in both directories.                                00440000
  Each head entry is linked to 0 or more subentries (a typical          00445000
subentry is shown in the next table).  There is  one  subentry          00450000
for  each  file (including spoofles) which exists for a device          00455000
or device class.  A null chain (0 subentries) consists of head          00460000
pointer = 0 and tail pointer = segment-relative address of the          00465000
head pointer.  If one or more subentries exists, the  pointers          00470000
are  segment-relative addresses of the first word of the first          00475000
and last subentries of the chain.  Any intermediate subentries          00480000
are forward-linked through the subentries.  The tail  subentry          00485000
always contains a 0-link.                                               00490000
  Subentries are linked first by descending priority, then  by          00495000
class  (only if in the class chain), and finally by rank (time          00500000
stamp in the subentry).  As priorities and/or  devices  change          00505000
(:ALTSPOOLFILE or SPOOK), subentries must be relinked to main-          00510000
tain the above order.                                                   00515000
  The Device Outfence and LDEV# fields are meaningless for the          00520000
class entry.  For logical device entries (non-0 Logical Device          00525000
field), a non-0 Device Outfence means that this outfence over-          00530000
rides the system-wide outfence in word 4 of entry 0, but  only          00535000
for this device.                                                        00540000
$PAGE                                                                   00545000
         Typical subentry (%40 words)                                   00550000
         ----------------------------                                   00555000
                                                                        00560000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00565000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00570000
 0|VF|State|  Outpri   |CL|///////////////////////|0                    00575000
  +--+--+--+-----------+--+-----------------------+                     00580000
 1| Type|                Job number               |1                    00585000
  +-----+-----------------------------------------+                     00590000
 2|                                               |2                    00595000
 3|                   User name                   |3                    00600000
 4|                                               |4                    00605000
 5|                                               |5                    00610000
  +-----------------------------------------------+                     00615000
 6|                                               |6                    00620000
 7|                 Account name                  |7                    00625000
10|                                               |8                    00630000
11|                                               |9                    00635000
  +-----------------------------------------------+                     00640000
12|                                               |10                   00645000
13|                    Job name                   |11                   00650000
14|                                               |12                   00655000
15|                                               |13                   00660000
  +-----------------------------------------------+                     00665000
16|                                               |14                   00670000
17|                   File name                   |15                   00675000
20|                                               |16                   00680000
21|                                               |17                   00685000
  +--+--------------------------------------------+                     00690000
22|IO|              Device file ID                |18                   00695000
  +--+--+-----------------+-----------------------+                     00700000
23|FS|DA|//|   XDD head index (see explanation)   |19          <<B8389>>00705000
  +--+--+-----------------+-----------------------+                     00710000
24|  Logical device, or Device Class Table index  |20                   00715000
  +-----------------------------------------------+                     00720000
25|  Virtual LDEV number of open spoolfile        |21                   00725000
  +-----------------------+-----------------------+                     00730000
26|  Volume Table index   |   Sector address...   |22                   00735000
  +-----------------------+                       |                     00740000
27|                           of spoofle label.   |23                   00745000
  +-----------------------------------------------+                     00750000
30|   Number of extents   |///////////////////////|24                   00755000
  +-----------------------+-----------------------+                     00760000
31|           Last extent size (sectors)          |25                   00765000
  +--+--+--+--+--+--+--+--------------------------+                     00770000
32|SQ|//|RS|FD|SO|AB|//|     Number of copies     |26                   00775000
  +--+--+--+--+--+--+--+--------------------------+                     00780000
33|    Segment-relative link to next subentry,    |27                   00785000
  |    this device or class. 0 ==> last subentry. |                     00790000
  +-----------------------------------------------+                     00795000
34|   Number of records in spoofle (doubleword)   |28                   00800000
35|                                               |29                   00805000
  +-----------------------+-----------------------+                     00810000
36|     Year MOD 100      | Julian Day of Year/2  |30                   00815000
  +--+--------------+-----------------+-----------+                     00820000
37|DY| Hour (24 hr) |     Minute      |///////////|31                   00825000
  +--+--------------+-----------------+-----------+                     00830000
$PAGE                                                                   00835000
Note:  Words 0-%24 are used in all subentries.  Words %25-%37,          00840000
       although present in all subentries, are zero unless the          00845000
       subentry is for a spooled file (spoofle).                        00850000
                                                                        00855000
Word   0:  VF    -- An "entry visited" flag for SHOWFILES.              00860000
           State -- State of subentry:                                  00865000
                      0 ==> Active                                      00870000
                      1 ==> Ready                                       00875000
                      2 ==> Open                                        00880000
                      3 ==> Locked                                      00885000
           CL    -- 1 ==> Word %24 is a class index  into  the          00890000
                          Device Class Table.                           00895000
                    0 ==> Word %24 is the LDEV associated with          00900000
                          this subentry.                                00905000
Word   1:  Type  -- Describes which  environment  created  the          00910000
                    subentry:                                           00915000
                      0 ==> Session' (SPOOK)                            00920000
                      1 ==> Session                                     00925000
                      2 ==> Job                                         00930000
                      3 ==> Job'     (SPOOK)                            00935000
Word %22:  IO    -- 1 ==> Output DFID                                   00940000
                    0 ==> Input  DFID                                   00945000
Word %23:  FS    -- There are one or more  forms  message  re-          00950000
                    quests in the spoofle.                              00955000
           DA    -- The spoofle was created via a :DATA record          00960000
                    (input spooling only).                              00965000
Word %25:  VDEV  -- LPDT index of virtual device  LDEV.  Simu-          00970000
                    lates the properties of a real LDEV to the          00975000
                    process which  FOPENs  a  new  (previously          00980000
                    non-existing)  file  (State field (XDD(0).          00985000
                    (1:2)) = 2 (Open)).                                 00990000
Word %26:  VTINX -- The volume table index of the logical  de-          00995000
                    vice  in  class SPOOL where the file label          01000000
                    (first extent) of the spoofle lives.                01005000
Word %34:  SQ    -- 1 ==> Squeeze (purge) spoofle  extents  as          01010000
                          the final copy is printed.                    01015000
                    0 ==> Purge only when final copy printed.           01020000
           RS    -- 1 ==> Restart job when warmstarting (input          01025000
                          spooling only).                               01030000
           FD    -- 1 ==> There are non-standard forms on  the          01035000
                          device.                                       01040000
           SO    -- Spaced Out bit.  File System could not ac-          01045000
                    quire a new extent when creating spoofle.           01050000
           AB    -- This is the $STDLIST of an aborted job.             01055000
Words %36-37:    -- Time stamp when spoofle was made READY, or          01060000
                    0D if not closed properly.  Julian day  is          01065000
                    9 bits starting with Word %36, bit 8.               01070000
                                                                        01075000
Head index:  The (segment-relative address)/4 of the head  en-          01080000
             try  with  which  this subentry is linked.  Since          01085000
             head entries are four words  long,  this  can  be          01090000
             thought  of  as an index into the head entry por-          01095000
             tion of the XDD -- if you disallow  values  of  0          01100000
             and 1.                                            <<B8389>>01105000
$PAGE                                                                   01110000
$IF X8 = OFF                                                            01115000
$CONTROL LIST                                                           01120000
$IF                                                                     01125000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01130000
             |  Declarations start here  |                              01135000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01140000
Conventions used in the declarations:                                   01145000
1.  We presume the existence of the following  logical  arrays          01150000
    or pointers:                                                        01155000
  a)  XDD           -- when referencing the master entry or  a          01160000
                       data  segment  relative  address (e.g.,          01165000
                       setting an LDEV head entry):                     01170000
                      @XDD'HEAD := @XDD(LDEV*SIZE'OF'XDD'HEAD)          01175000
  b)  XDD'HEAD      -- when referencing a head entry.                   01180000
  c)  XDD'SUBENTRY  -- when referencing a subentry.                     01185000
  d)  XDD'BSUBENTRY -- byte array equivalent of XDD'SUBENTRY.           01190000
  e)  XDD'DSUBENTRY -- double array equivalent of XDD'SUBENTRY          01195000
    Use the array size EQUATEs below (2x for XDD'BSUBENTRY and          01200000
    x/2 for XDD'DSUBENTRY). The 0-element of all arrays is as-          01205000
    sumed to be the first word of the current entry, -NOT- the          01210000
    first word of that area of the XDD.  The arrays can be di-          01215000
    rect, indirect, DB-relative or Q-relative. If DB-relative,          01220000
    make sure you know where DB is before you  use  them.  The          01225000
    only  time  you  have to explicitly reference them is when          01230000
    you declare them and when you set their starting  address.          01235000
    (Note the EQUATE to get you the class head entry).  There-          01240000
    after the DEFINEs below will  implicitly  reference  them.          01245000
    You must use the DEFINEs though.                                    01250000
2.  Prefixes in the DEFINEs are:                                        01255000
  a)  XDD0  -- when referencing something in the master entry.          01260000
  b)  XDDH  -- when referencing something in a head entry.              01265000
  c)  XDDS  -- when referencing something relevant to both  an          01270000
               IDD subentry and an ODD subentry.                        01275000
  d)  XDDSB -- when using a byte reference in an XDD subentry.          01280000
  e)  XDDSD -- when using a double reference in  an  XDD  sub-          01285000
               entry.                                                   01290000
  f)  ODDS  -- when referencing something relevant only to  an          01295000
               ODD subentry.                                            01300000
  g)  IDDS  -- when referencing something relevant only to  an          01305000
               IDD subentry.                                            01310000
3.  Within each set of prefixes, symbols are given  alphabeti-          01315000
    cally for easier lookup without using XREF.                         01320000
;                                                                       01325000
EQUATE                                                                  01330000
   IDD'DST               = 45                       ,                   01335000
   IDD'SIR               =  3                       ,                   01340000
                                                                        01345000
   ODD'DST               = 46                       ,                   01350000
   ODD'SIR               =  4                       ,                   01355000
$PAGE                                                                   01360000
<< The following three EQUATE's must be changed if XDD  en- >>          01365000
<< try lengths change.                                      >>          01370000
                                                                        01375000
   SIZE'OF'XDD0          =  8                       ,                   01380000
   SIZE'OF'XDD'HEAD      =  4                       ,                   01385000
   SIZE'OF'XDD'SUBENTRY  = 32                       ,                   01390000
                                                                        01395000
   XDD'MPE'VERSION       =  5                       ,                   01400000
   XDD'CLASS'INDEX       =  2                       ,                   01405000
   XDD'CLASS'ENTRY       = XDD'CLASS'INDEX *                            01410000
                             SIZE'OF'XDD'HEAD       ;                   01415000
                                                                        01420000
<< XDD zero'th entry fields                                 >>          01425000
                                                                        01430000
DEFINE                                                                  01435000
   XDD0'CURRENT'SECTORS  = XDD(0).(8:8)            #,                   01440000
   XDD0'HEAD'LENGTH      = XDD(1).(0:8)            #,                   01445000
   XDD0'MAX'SECTORS      = XDD(0).(0:8)            #,                   01450000
   XDD0'NEXT'DFID        = XDD(3).(1:15)           #,                   01455000
   XDD0'SUBENTRY'AREA    = XDD(2)                  #,                   01460000
   XDD0'SUBENTRY'LENGTH  = XDD(1).(8:8)            #,                   01465000
   XDD0'SYSTEM'OUTFENCE  = XDD(4).(12:4)           #,                   01470000
   XDD0'IDD'OR'ODD       = XDD(3).(0:1)            #,                   01475000
        XDD0'IDD         = 0                       #,                   01480000
        XDD0'ODD         = 1                       #;                   01485000
                                                                        01490000
<< XDD head entry fields                                    >>          01495000
                                                                        01500000
DEFINE                                                                  01505000
   XDDH'DEV'OUTFENCE     = XDD'HEAD(0).(0:8)       #,                   01510000
   XDDH'FIRST'SUBENTRY   = XDD'HEAD(1)             #,                   01515000
   XDDH'LAST'SUBENTRY    = XDD'HEAD(2)             #,                   01520000
   XDDH'LDEV             = XDD'HEAD(3)             #;                   01525000
                                                                        01530000
<< XDD subentry fields (except IDD/ODD specific fields).    >>          01535000
                                                                        01540000
DEFINE                                                                  01545000
   XDDS'ACCOUNT'NAME     = XDD'SUBENTRY(6)         #,                   01550000
   XDDS'CLASS            = XDD'SUBENTRY(0).(7:1)   #,                   01555000
   XDDS'DAY'OF'YEAR      = XDD'SUBENTRY(30).(8:8) & LSL(1)              01560000
                               LOR XDD'SUBENTRY(31).(0:1) #,            01565000
   XDDS'DEVICE           = XDD'SUBENTRY(20)        #,                   01570000
   XDDS'DFID'IN'OR'OUT   = XDD'SUBENTRY(18).(0:1)  #,                   01575000
        XDDS'DFID'IN     = 0                       #,                   01580000
        XDDS'DFID'OUT    = 1                       #,                   01585000
   XDDS'DFID'NUMBER      = XDD'SUBENTRY(18).(1:15) #,                   01590000
   XDDS'FILE'NAME        = XDD'SUBENTRY(14)        #,                   01595000
   XDDS'HEAD'INDEX       = XDD'SUBENTRY(19).(3:13) #,          <<B8389>>01600000
   XDDS'HOUR             = XDD'SUBENTRY(31).(1:5)  #,                   01605000
   XDDS'JOB'NAME         = XDD'SUBENTRY(10)        #,                   01610000
   XDDS'JOB'NUMBER       = XDD'SUBENTRY(1).(2:14)  #,                   01615000
   XDDS'JOB'TYPE         = XDD'SUBENTRY(1).(0:2)   #,                   01620000
        XDDS'SESSION'    = 0                       #,                   01625000
        XDDS'SESSION     = 1                       #,                   01630000
        XDDS'JOB         = 2                       #,                   01635000
        XDDS'JOB'        = 3                       #,                   01640000
   XDDS'LAST'EXTENT'SIZE = XDD'SUBENTRY(25)        #,                   01645000
   XDDS'LSW'LABEL        = XDD'SUBENTRY(23)        #,                   01650000
   XDDS'LSW'RECORD'COUNT = XDD'SUBENTRY(29)        #,                   01655000
   XDDS'MINUTE           = XDD'SUBENTRY(31).(6:6)  #,                   01660000
   XDDS'MSW'LABEL        = XDD'SUBENTRY(22).(8:8)  #,                   01665000
   XDDS'MSW'RECORD'COUNT = XDD'SUBENTRY(28)        #,                   01670000
   XDDS'NEXT'SUBENTRY    = XDD'SUBENTRY(27)        #,                   01675000
      XDDS'END'OF'CHAIN  = 0                       #,                   01680000
   XDDS'NUMBER'EXTENTS   = XDD'SUBENTRY(24).(0:8)  #,                   01685000
   XDDS'OUTPUT'PRIORITY  = XDD'SUBENTRY(0).(3:4)   #,                   01690000
   XDDS'SPACED'OUT       = XDD'SUBENTRY(26).(4:1)  #,                   01695000
   XDDS'SPOOFLE'VT'INDEX = XDD'SUBENTRY(22).(0:8)  #,                   01700000
   XDDS'SPOOL'STATE      = XDD'SUBENTRY(0).(1:2)   #,                   01705000
        XDDS'ACTIVE      = 0                       #,                   01710000
        XDDS'READY       = 1                       #,                   01715000
        XDDS'OPEN        = 2                       #,                   01720000
        XDDS'LOCKED      = 3                       #,                   01725000
   XDDS'SUBENTRY'VISITED = XDD'SUBENTRY(0).(0:1)   #,                   01730000
   XDDS'UNUSED'SUBENTRY  = 0                       #,                   01735000
   XDDS'USER'NAME        = XDD'SUBENTRY(2)         #,                   01740000
   XDDS'VIRTUAL'LDEV     = XDD'SUBENTRY(21)        #,                   01745000
   XDDS'YEAR             = XDD'SUBENTRY(30).(0:8)  #,                   01750000
   XDDSB'ACCOUNT'NAME    = XDD'BSUBENTRY(12)       #,                   01755000
   XDDSB'FILE'NAME       = XDD'BSUBENTRY(28)       #,                   01760000
   XDDSB'JOB'NAME        = XDD'BSUBENTRY(20)       #,                   01765000
   XDDSB'USER'NAME       = XDD'BSUBENTRY(4)        #,                   01770000
   XDDSD'DISC'LABEL      = XDD'DSUBENTRY(11)       #,                   01775000
   XDDSD'READY'TIME      = XDD'DSUBENTRY(15)       #,                   01780000
   XDDSD'RECORD'COUNT    = XDD'DSUBENTRY(14)       #;                   01785000
                                                                        01790000
<< IDD-only subentry fields.                                >>          01795000
                                                                        01800000
DEFINE                                                                  01805000
   IDDS'DATA             = XDD'SUBENTRY(19).(1:1)  #,                   01810000
   IDDS'RESTART          = XDD'SUBENTRY(26).(2:1)  #;                   01815000
                                                                        01820000
<< ODD-only subentry fields.                                >>          01825000
                                                                        01830000
DEFINE                                                                  01835000
   ODDS'ABORTED'JOB      = XDD'SUBENTRY(26).(5:1)  #,                   01840000
   ODDS'FORMS'IN'FILE    = XDD'SUBENTRY(19).(0:1)  #,                   01845000
   ODDS'FORMS'ON'DEVICE  = XDD'SUBENTRY(26).(3:1)  #,                   01850000
   ODDS'NUMBER'COPIES    = XDD'SUBENTRY(26).(8:8)  #,                   01855000
   ODDS'PURGE'EXTENTS    = XDD'SUBENTRY(26).(0:1)  #;                   01860000
                                                                        01865000
COMMENT --                                                              01870000
<<**********************************************************>>          01875000
<<*                                                        *>>          01880000
<<*                     END INCLXDD                        *>>          01885000
<<*                                                        *>>          01890000
<<**********************************************************>>          01895000
;                                                                       01900000
