         << LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION >>     00000001
$PAGE "MPE TABLE ACCESS:  LOGICAL/PHYSICAL DEVICE TABLE (LPDT)"         00005000
<<**********************************************************>>          00010000
<<*                                                        *>>          00015000
<<*                INCLLPDT - Module F8                    *>>          00020000
<<*                    MPE5 version                        *>>          00025000
<<*                                                        *>>          00030000
<<**********************************************************>>          00035000
                                                                        00040000
$IF X8 = OFF                                                            00045000
$CONTROL NOLIST                                                         00050000
$IF                                                                     00055000
COMMENT --                                                              00060000
                                                                        00065000
LOGICAL-TO-PHYSICAL DEVICE TABLE (LPDT)                                 00070000
---------------------------------------                                 00075000
                                                                        00080000
DST = 13 (= %15)                                                        00085000
SIR =  9 (= %11)                                                        00090000
                                                                        00095000
  The LPDT has several fields which describe the  state  of  a          00100000
device. Some of these fields have the same meaning for all de-          00105000
vices.  Others are device dependent.  All are described below.          00110000
  The LPDT is one of the most popular--and most abused--tables          00115000
in MPE.  The chief reason for its popularity  is  that  it  is          00120000
main-memory  resident  and  has its own SYSDB-relative pointer          00125000
(SYSDB + 8, or absolute location %1010).  A designer who wants          00130000
to check some device  attribute  knows  that  the  attribute's          00135000
field  need  not  be brought in from disc if it is kept in the          00140000
LPDT.  This led to cramming entriely too much information into          00145000
the two-word entry used in MPE4 and before.  The  present  ex-          00150000
panded  entry  has  done  nothing  to address the overcrowding          00155000
problem because of the vast repercussions on most existing MPE          00160000
code and the time frame of the  expansion  enhancement.  Maybe          00165000
next time...                                                            00170000
  There are two types of devices represented in the LPDT: real          00175000
devices and virtual devices.  A real device is one  which  has          00180000
been  configured  into the system and is capable of performing          00185000
input and/or output.  A virtual device simulates some  of  the          00190000
properties of a real device (for example a spooled line print-          00195000
er or an INP), but there is no physical I/O involved.  The two          00200000
main uses for virtual devices are for OPEN spooled devicefiles          00205000
and certain communication devices (such as INP's).                      00210000
  A given virtual device entry is in use only  while  the  de-          00215000
vicefile it represents is open.  When the file is FCLOSEd, the          00220000
entry becomes available for another virtual  device.  This  is          00225000
the reason for the SYSDUMP/INITIAL configurator question MAX #          00230000
OF OPEN SPOOLFILES--it needs to know how many  virtual  device          00235000
entries to allocate to the LPDT (and to the LDT).                       00240000
  Entries in the LPDT are ordered by  logical  device  number.          00245000
The  first  word address of a real device entry is obtained by          00250000
multiplying the LDN by the entry size.  Except for the 0th en-          00255000
try, entries for which no logical device is  configured  on  a          00260000
given system are used for virtual device entries.  Any remain-          00265000
ing virtual device entries follow the last real device entry.           00270000
$PAGE                                                                   00275000
                       Entry 0                                          00280000
                       -------                                          00285000
                                                                        00290000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00295000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00300000
 0|          Number of entries in table           |                     00305000
  +-----------------------------------------------+                     00310000
 1|                Entry size = 4                 |                     00315000
  +-----------------------------------------------+                     00320000
 2|         DEVREC service request count          |                     00325000
  +-----------------------------------------------+                     00330000
 3|///////////////////////////////////////////////|                     00335000
  +-----------------------------------------------+                     00340000
                                                                        00345000
Discussion:                                                             00350000
  Word 2 is incremented by a device driver  whenever  it  sets          00355000
the  Device  Ownership  State  field (below) to 2 (Service Re-          00360000
quested).  DEVREC decrements the count for each  interrupt  it          00365000
services  until  the count reaches 0, at which time DEVREC hi-          00370000
bernates.                                                               00375000
                       -- CAUTION --                                    00380000
         Device drivers must lock this table by  DIS-                   00385000
         ABLE/ENABLEing,  -NOT-  by trying to acquire                   00390000
         the LPDT SIR.                                                  00395000
                                                                        00400000
                                                                        00405000
          Typical entry (virtual devices)                               00410000
          -------------------------------                               00415000
                                                                        00420000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00425000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00430000
 0| 1|           Pointer to XDD subentry          |            <<07324>>00435000
  +--+--+--+--+--+--+--+--------+--+--+-----------+                     00440000
 1|     |  |  |  |  |  |        |  |  |           |                     00445000
  +-----+--+--+--+--+--+--------+--+--+-----------+                     00450000
 2|///////////////////////////////////////////////|                     00455000
  +--+--------------------------------------------+            <<07324>>00460000
 3|IO|////////////////////////////////////////////|            <<07324>>00465000
  +--+--------------------------------------------+            <<07324>>00470000
                                                                        00475000
IO -- 0 for input, 1 for output.                                        00480000
                                                                        00485000
Word 0, bit 0 is 1 for a virtual device, 0 for a real  device.          00490000
The  fields  in word 1 are the same, as applicable, as for the          00495000
real device represented by a given virtual device.  See below.          00500000
$PAGE                                                                   00505000
          Typical entry (all real devices)                              00510000
          --------------------------------                              00515000
                                                                        00520000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00525000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00530000
 0| 0|////////////////////////////////////////////|                     00535000
  +--+--+--+--+--+--+--+--------+--+--+-----------+                     00540000
  |Devc | J|Da|  | D| I| End of |  |  |Au: Device |                     00545000
 1|Owned| o|ta|  | u| n|  File  |  |  |to: Subtype|                     00550000
  |State| b|  |  | p| t|Cndition|  |  |  :        |                     00555000
  +-----+--+--+--+--+--+--------+--+--+-----------+                     00560000
 2|       SYSDB-relative pointer to the DIT       |                     00565000
  +-----------------------------------------------+                     00570000
 3|///////////////////////////////////////////////|                     00575000
  +-----------------------------------------------+                     00580000
                                                                        00585000
Discussion:                                                             00590000
  Word 1.( 0:2) -- Device Ownership State:                              00595000
                   0 -- Not owned by any process.                       00600000
                   1 -- Owned by a process.                             00605000
                   2 -- Service requested.  Set by driver  for          00610000
                        unexpected  interrupt, then wakes DEV-          00615000
                        REC.                                            00620000
                   3 -- Service granted.  Set by DEVREC. Logon          00625000
                        sequence is 0-2-3-1.                            00630000
                   3 -- Device reserved (alternate  use).  Set          00635000
                        during   STARTSPOOL,  spooler  process          00640000
                        sets to 1 when it gets started.                 00645000
  Word 1.( 2:1) -- Device is Job/Session Accepting if true.             00650000
  Word 1.( 3:1) -- Device is Data Accepting if true.                    00655000
  Word 1.( 5:1) -- Device is Duplicative if true (all  devices          00660000
                   except discs).                                       00665000
  Word 1.( 6:1) -- Device is Interactive if true (all  devices          00670000
                   except discs).                                       00675000
  Word 1.( 7:3) -- End of File condition:                               00680000
                   0 -- No EOF detected.                                00685000
                   1 -- Hardware EOF (e.g., tape mark).                 00690000
                   2 -- :DATA  record read.                             00695000
                   3 -- :EOD   record read.                             00700000
                   4 -- :HELLO record read.                             00705000
                   5 -- :BYE   record read.                             00710000
                   6 -- :JOB   record read.                             00715000
                   7 -- :EOJ   record read.                             00720000
  Word 1.(12:4) -- Device subtype. See discussion for tape en-          00725000
                   try (below) for a description of  the  Auto          00730000
                   bit (12:1).                                          00735000
  The remaining bits in Word 1 are  device-dependent  and  are          00740000
described with their corresponding entry diagram.                       00745000
$PAGE                                                                   00750000
          Entry for terminal-like devices                               00755000
          -------------------------------                               00760000
                                                                        00765000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00770000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00775000
 0| 0|////////////////////////////////////////////|                     00780000
  +--+--+--+--+--+--+--+--------+--+--+-----------+                     00785000
  |Devc | J|Da|Ct| D| I| End of | B| L|    Device |                     00790000
 1|Owned| o|ta|lY| u| n|  File  | r| o|    Subtype|                     00795000
  |State| b|  |  | p| t|Cndition| k| g|           |                     00800000
  +-----+--+--+--+--+--+--------+--+--+-----------+                     00805000
 2|       SYSDB-relative pointer to the DIT       |                     00810000
  +-----------------------------------------------+                     00815000
 3|///////////////////////////////////////////////|                     00820000
  +-----------------------------------------------+                     00825000
                                                                        00830000
Discussion (unique fields only):                                        00835000
  Word 1.( 4:1) -- CONTROL-Y is allowed and has been detected.          00840000
  Word 1.(10:1) -- BREAK has been detected -OR-  ignore  BREAK          00845000
                   if the C.I. is running.                              00850000
  Word 1.(11:1) -- The terminal is logging on. This bit is set          00855000
                   by  PROGEN  and  DEVREC  when the logon se-          00860000
                   quence starts.  If  the  bit  is  off  when          00865000
                   polled  by  INITJSMP, the terminal has dis-          00870000
                   connected.  For now, only IOTERM0 and  HIO-          00875000
                   TERM0  support the use of this bit.  Multi-          00880000
                   point and DS pseudo-terminals do not.                00885000
                                                                        00890000
               Entry for tape drives                                    00895000
               ---------------------                                    00900000
                                                                        00905000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00910000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00915000
 0| 0|////////////////////////////////////////////|                     00920000
  +--+--+--+--+--+--+--+--------+--+--+-----------+                     00925000
  |Devc | J|Da| B| D| I| End of |  | A|Au: Device |                     00930000
 1|Owned| o|ta| O| u| n|  File  |  | V|to: Subtype|                     00935000
  |State| b|  | T| p| t|Cndition|  | R|  :        |                     00940000
  +-----+--+--+--+--+--+--------+--+--+-----------+                     00945000
 2|       SYSDB-relative pointer to the DIT       |                     00950000
  +-----------------------------------------------+                     00955000
 3|///////////////////////////////////////////////|                     00960000
  +-----------------------------------------------+                     00965000
                                                                        00970000
Discussion (unique fields only):                                        00975000
  Word 1.( 4:1) -- BOT.  Tape is at Load Point  -OR-  no  tape          00980000
                   mounted.  Recording  density  may  only  be          00985000
                   switched when this bit is true (for  multi-          00990000
                   ple density tape drives).                            00995000
  Word 1.(11:1) -- If true,  DEVREC  is  performing  Automatic          01000000
                   Volume  Recognition  (AVR)  on  a  tape (or          01005000
                   PVPROC is doing the same on a serial disc),          01010000
                   -OR- AVR is to be suppressed on job or data          01015000
                   accepting devices.                                   01020000
$PAGE                                                                   01025000
  Word 1.(12:1) -- Part of Device Subtype field.  If true, de-          01030000
                   vice  is   allocated   automatically   when          01035000
                   opened.  If false, operator must allocate.           01040000
                                                                        01045000
               Entry for disc drives                                    01050000
               ---------------------                                    01055000
                                                                        01060000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      01065000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     01070000
 0| 0|////////////////////////////////////////////|                     01075000
  +--+--+--+--+--+--+--+--------+--+--+-----------+                     01080000
  |Devc | J|Da| N|Mt|RV| End of | S| F|    Device |                     01085000
 1|Owned| o|ta| S|d |  |  File  |or| o|    Subtype|                     01090000
  |State| b|  | D|PV|  |Cndition| F| r|           |                     01095000
  +-----+--+--+--+--+--+--------+--+--+-----------+                     01100000
 2|       SYSDB-relative pointer to the DIT       |                     01105000
  +--+--+-----------------------------------------+            <<07324>>01110000
 3|//|SD|/////////////////////////////////////////|            <<07324>>01115000
  +--+--+-----------------------------------------+            <<07324>>01120000
                                                                        01125000
Discussion (unique fields only):                                        01130000
  Word 1.( 0:2) -- Device  Ownership  State.  May  not  be   1          01135000
                   (owned) for shared device (system volume or          01140000
                   private volume).  Serial and foreign  discs          01145000
                   are non-sharable and may be owned.  See the          01150000
                   full discussion of this field under Typical          01155000
                   Entry, above.                                        01160000
  Word 1.( 4:1) -- If true, the disc is  a  non-system  domain          01165000
                   (private  volume,  serial  disc  or foreign          01170000
                   disc) disc drive.                                    01175000
  Word 1.( 5:1) -- If true, disc is a mounted private volume.           01180000
  Word 1.( 6:1) -- If true, the disc is a reserved volume used          01185000
                   to satisfy the requirements of a  multiple-          01190000
                   volume private volume set.                           01195000
  Word 1.(10:1) -- If true, the disc is a physically and logi-          01200000
                   cally mounted serial or foreign disc.  Bits          01205000
                   5 and 6 must be false.                               01210000
  Word 1.(11:1) -- If bit 10 is true, then 1 ==> foreign disc,          01215000
                   0 ==> serial disc.                                   01220000
  Word 3.( 1:1) -- If true, the device is currently being used <<07324>>01225000
                   as a serial disc (that is, it is  allocated <<07324>>01230000
                   to  a user as a serial disc).  This bit du- <<07324>>01235000
                   plicates a bit in the LDTX  entry  so  that <<07324>>01240000
                   this  information  can be found in a system <<07324>>01245000
                   (memory-resident) table.                    <<07324>>01250000
$PAGE                                                                   01255000
$IF X8 = OFF                                                            01260000
$CONTROL LIST                                                           01265000
$IF                                                                     01270000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01275000
             |  Declarations start here  |                              01280000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01285000
                                                                        01290000
Conventions used in the declarations:                                   01295000
1.  The LPDT is referenced via the system pointer at  absolute          01300000
    location  %1010.  The pointer is declared in this $INCLUDE          01305000
    file.                                                               01310000
2.  We assume the existence of an offset integer,  LPDT'INDEX,          01315000
    to  access a particular LPDT entry.  LPDT'INDEX would nor-          01320000
    mally be set to LDEV# * LPDT'ENTRY'SIZE.                            01325000
3.  Each DEFINE is prefixed by LPDT'... to distinguish it from          01330000
    references to other MPE tables.                                     01335000
4.  DEFINEs of fields are  listed  alphabetically  for  easier          01340000
    lookup without using XREF. DEFINEs of states of fields are          01345000
    listed sequentially following the field DEFINE.  The  com-          01350000
    ment field indicates for which device(s) a symbol is rele-          01355000
    vant, according to the following code:                              01360000
       ABD -- All But Disc              TAP -- tape            <<A8963>>01365000
       ALL -- all devices               TPN -- tape/NSD (-PVs) <<A8963>>01370000
       DSC -- all discs                 TRM -- terminal        <<A8963>>01375000
       NSD -- non-system domain discs   VDV -- virtual devices <<A8963>>01380000
;                                                                       01385000
$IF X6 = OFF                                                            01390000
                                                                        01395000
LOGICAL POINTER                                                         01400000
   LPDT                   =   8;                                        01405000
                                                                        01410000
$IF                                                                     01415000
                                                                        01420000
EQUATE                                                                  01425000
   LPDT'DST               = %15,                                        01430000
   LPDT'SIR               = %11,                                        01435000
   LPDT'MPE'VERSION       =   5,                                        01440000
                                                                        01445000
<< The following EQUATE must be changed if the length of an >>          01450000
<< LPDT entry changes.                                      >>          01455000
                                                                        01460000
   SIZE'OF'LPDT'ENTRY     =   4;                                        01465000
$PAGE                                                                   01470000
DEFINE                                                                  01475000
   LPDT'AUTO'ALLOC        = LPDT(LPDT'INDEX+3).(2:1) #,<<TPN>> <<A8963>>01480000
   LPDT'AUTO'SUBTYPE      = LPDT(LPDT'INDEX+1).(13:3)#,<<TAP>>          01485000
   LPDT'BREAK             = LPDT(LPDT'INDEX+1).(10:1)#,<<TRM>>          01490000
   LPDT'CONTROL'Y         = LPDT(LPDT'INDEX+1).(4:1) #,<<TRM>>          01495000
   LPDT'DATA'ACCEPT       = LPDT(LPDT'INDEX+1).(3:1) #,<<ALL>>          01500000
   LPDT'DEV'OWN'STATE     = LPDT(LPDT'INDEX+1).(0:2) #,<<ALL>>          01505000
      LPDT'NOT'OWNED      = 0                        #,                 01510000
      LPDT'OWNED          = 1                        #,                 01515000
      LPDT'SERVICE'REQ    = 2                        #,                 01520000
      LPDT'SERVICE'OK     = 3                        #,                 01525000
      LPDT'RESERVED       = 3                        #,                 01530000
   LPDT'DIT'PTR           = LPDT(LPDT'INDEX+2)       #,<<ALL>>          01535000
   LPDT'DUPLICATIVE       = LPDT(LPDT'INDEX+1).(5:1) #,<<ABD>>          01540000
   LPDT'ENTRY'SIZE        = LPDT(1)                  #,                 01545000
   LPDT'EOF'TYPE          = LPDT(LPDT'INDEX+1).(7:3) #,<<ALL>>          01550000
      LPDT'NO'EOF         = 0                        #,                 01555000
      LPDT'HARDWARE'EOF   = 1                        #,                 01560000
      LPDT'DATA           = 2                        #,                 01565000
      LPDT'EOD            = 3                        #,                 01570000
      LPDT'HELLO          = 4                        #,                 01575000
      LPDT'BYE            = 5                        #,                 01580000
      LPDT'JOB            = 6                        #,                 01585000
      LPDT'EOJ            = 7                        #,                 01590000
   LPDT'INTERACTIVE       = LPDT(LPDT'INDEX+1).(6:1) #,<<ABD>>          01595000
   LPDT'JOB'ACCEPT        = LPDT(LPDT'INDEX+1).(2:1) #,<<ALL>>          01600000
   LPDT'LOAD'POINT        = LPDT(LPDT'INDEX+1).(4:1) #,<<TAP>>          01605000
   LPDT'LOGGING'ON        = LPDT(LPDT'INDEX+1).(11:1)#,<<TRM>>          01610000
   LPDT'MAX'ENTRIES       = LPDT(0)                  #,                 01615000
   LPDT'MOUNTED'PV        = LPDT(LPDT'INDEX+1).(5:1) #,<<NSD>>          01620000
   LPDT'NON'SYS'DOMAIN    = LPDT(LPDT'INDEX+1).(4:1) #,<<DSC>>          01625000
   LPDT'NOT'PV'OR'SYS     = LPDT(LPDT'INDEX+1).(4:3) = 4#,              01630000
   LPDT'RDY'SER'FRN'DISC  = LPDT(LPDT'INDEX+1).(10:1)#,<<NSD>>          01635000
   LPDT'RESERVED'PV       = LPDT(LPDT'INDEX+1).(6:1) #,<<NSD>>          01640000
   LPDT'SERIAL'DISC       = LPDT(LPDT'INDEX+3).(1:1) #,<<NSD>> <<07324>>01645000
   LPDT'SERIAL'OR'FOREIGN = LPDT(LPDT'INDEX+1).(11:1)#,<<NSD>>          01650000
      LPDT'SERIAL         = 0                        #,                 01655000
      LPDT'FOREIGN        = 1                        #,                 01660000
   LPDT'SERV'REQ'COUNT    = LPDT(2)                  #,                 01665000
   LPDT'SUBTYPE           = LPDT(LPDT'INDEX+1).(12:4)#,<<ALL>>          01670000
   LPDT'TAPE'AUTO'ALLOC   = LPDT(LPDT'INDEX+1).(12:1)#,<<TAP>> <<A8963>>01675000
   LPDT'TAPE'AVR          = LPDT(LPDT'INDEX+1).(11:1)#,<<TAP>>          01680000
   LPDT'VDEV'DIRECTION    = LPDT(LPDT'INDEX+3).(0:1) #,<<VDV>> <<07324>>01685000
      LPDT'VDEV'INPUT     = 0                        #,                 01690000
      LPDT'VDEV'OUTPUT    = 1                        #,                 01695000
   LPDT'VIRTUAL'DEVICE    = LPDT(LPDT'INDEX  ).(0:1) #,<<VDV>> <<07324>>01700000
   LPDT'XDD'SUBENTRY'PTR  = LPDT(LPDT'INDEX  ).(1:15)#;<<VDV>> <<07324>>01705000
                                                                        01710000
COMMENT --                                                              01715000
<<**********************************************************>>          01720000
<<*                                                        *>>          01725000
<<*                    END INCLLPDT                        *>>          01730000
<<*                                                        *>>          01735000
<<**********************************************************>>          01740000
;                                                                       01745000
