         DEF      SSDAT
MONSIM   SET      0                 MONITOR SIMULATOR OFF
*
*  SET FLAG TO INCLUDE READ CHECK CODE.  SAME FLAG IS IN
*  SWAPPER, TSIO, DPSIO.
*
RDCK     EQU      0                 NO READ CHECK
*
         SYSTEM   UTS
*        CREATED 1/6/72   PJH
SYSGEN   SET      0
SYSGEN   SET      1
*
* SCHEDULER,SWAPPER TABLES
*
SSDAT    EQU      %
*************************************
* EXEC SCHEDULER DATA               *
         DEF      S:BUIS
         DEF      S:BFIS
         DEF      M:RCLOK2
         DEF      S:HIR
         DO       1-SYSGEN
         DEF      SMBUIS
         DEF      SMUIS
         ELSE
         REF      SMUIS
         FIN
         DEF      S:CUIS
         DEF      S:OUIS
         DEF      S:GUIS
         DEF      S:MBSF
         DEF      S:SIP
         DEF      S:USID
         DEF      ONLN
         DEF      S:OPC
         DEF      SL:OPC
         DEF      SB:RTUS
         DEF      GJOB
         DEF      S:MAPCW
         DEF      S:ACCW
         DEF      S:SJACCW
GJOB     EQU      X'40'             IN HIGH ORDER BYTE OF JIT
ONLN     EQU      X'80'             IN HIGH ORDER BYTE OF JIT
S:HIR    DATA     0                 HI-PRI READY TO RUN COUNT
M:RCLOK2 DATA     -1                CLOCK 2 COUNTER
         DO       1-SYSGEN
SMUIS    EQU      42                MAX UXERS IN SYSTEM
SMBUIS   EQU      1                 MAX BATCH JOBS IN SYSTEM
         FIN
S:CUIS   DATA     0                 CURRENT # OF USERS IN TEH SYSTEM
S:BUIS   DATA     0                 # OF BATCH JOBS RUNNING
S:OUIS   DATA     0
S:GUIS   DATA     0
S:BFIS   DATA     0                 # OF JOBS IN BATCH STREAM
S:SIP    DATA     0                 SWAP IN PROGRESS
S:USID   DATA     SMUIS             BATCH SYSID
S:OPC    DATA     4                 WORKING VALUE FOR OVERLAY PROTECTION COUNTER
SL:OPC   DATA     4                 REFRESH VALUE FOR S:OPC
S:PFNI   DATA     5                 PROCESSOR NORMALIZATION INTERVAL
SL:PFNI  DATA     5                 REFRESH VALUE FOR INTERVAL
*                                   (IN MINUTES)
         DEF      S:PFNI,SL:PFNI
SB:RTUS  DATA     0                 REAL TIME USER NUMBER FOR
*                                   USER IN CORE AND HIGHER IN PRIORITY
*                                   THAN CURRENT USER.
         BOUND    8
         REF      JOVVP,JCMAP,JJAC
*    MEMORY MAP CONTROL WORDS
*              INITIALIZED BY BOOTSUBR
S:MAPCW  GEN,15,17    0,JCMAP
         GEN,8,7,8,9  0,0,JOVVP,0
S:ACCW   GEN,15,17    0,JJAC
         GEN,8,7,8,9  0,0,JOVVP,0
S:SJACCW GEN,15,17    0,SPITJAC
         GEN,8,7,8,9  2,0,JOVVP,0
SPITJAC  DATA         X'55530000',0
         PAGE
*        |-------------------------------|             |---------------|
*     CL | SEEK         DISC ADR POINTER +------>  DAT | DA (DISC ADR) |
*        |-------------------------------|             |---------------|
*        | FLAGS          BYTE CNT = 2   |     ->      | DA            |
*        |-------------------------------|    /        |---------------|
*        | RD/WRT       (PP #) = MEM ADR |   /
*        |-------------------------------|  /
*        | FLAGS          BYTE CNT       | /
*        |-------------------------------|/
*     +4 |                               +
         DO       MONSIM
SMAXOUT  EQU      1
         ELSE
SMAXOUT  EQU      20
         FIN
         DEF      S:BECL
         DEF      SB:OSULT
         DEF      TSC3
         DEF      TSC4
         DEF      SDA%END
         DEF      SCL%END
         DEF      SWAP%PRI
         DEF      SX:HPP
         DEF      S:ISUN
         DEF      SB:NP
         DEF      SB:PNL
         DEF      S:PCT
         DEF      S:FPPH
         DEF      S:FPPT
         DEF      S:FPPC
         DEF      S:AJP
         DEF      SB:OSN
         DEF      SB:OSUL
         DEF      SB:FPN
         DEF      SB:FPL
         DEF      S:OSS
         DEF      S:BDA
         DEF      SH:EDA
         DEF      S:BCL
         DEF      S:ECL
         DEF      S:SCL
         DEF      SH:SDA
         DEF      SMAXOUT
         DEF      SCBPOOLIM
         DEF      SPOOL
         DEF      BUFLIMS
         DEF      MPOOLIM
         DEF      S:JCL
         DEF      SH:JAJDA
         DEF      CHNMSK
         DEF      C0MSK
         DEF      TSC0
         DEF      TSC1
         DEF      TSC2
         DEF      S:JSP
         DEF      SCLLIM
         DEF      DOWTCK
         DO       RDCK
         DEF      RDCKDSP1,RDCKDSP2,RDCKDSP3,RDCKDSP4
         DEF      DORDCK
         FIN
         DEF      BANPMC
         DEF      SB:#TBL
         DEF      SB:XTBL
         DEF      SB:WST
         DEF      S:C2SEEK
         DEF      S:#SWAP%DEV
         DEF      S:IOEA%ADR,S:SECTOR
*
*
         REF      NPMC
         REF      CPOOL
         REF      MPOOL
         REF      RECOVER0
         REF      CPOOLEND
*
SWAP%PRI EQU      X'10'
SX:HPP   DATA     0,0,0             PROCS TEMP PHY PG CHAIN HEAD
S:ISUN   DATA     3                 IN-SWAP USER NO.
S:ISUNF  DATA     0
S:SEVF   DATA     0
S:FSEVF  DATA     0                 FAILED SWAP EVENT COUNT
         DEF      S:ISUNF,S:SEVF,S:FSEVF
SB:NP    EQU      SB:PNL            NO PROCS TO SWAP IN
SB:PNL   DATA     0                 IN SWAP PROC NOS
         DATA     0
S:PCT    DATA     0                 PAGE COUNT TOTAL FOR SWAP IN
S:FPPH   DATA     0                 FREE PAGE POOL HEAD
S:FPPT   DATA     0                              TAIL
S:FPPC   DATA     0                                COUNT
S:AJP    DATA     0
SB:OSN   EQU      SB:OSUL           NO USERS TO SWAP OUT
SB:OSUL  BYTAB    SMAXOUT,0         OUT SWAP USER NOS
SB:OSULT BYTAB    SMAXOUT,0         SCRATCH TABLE
SB:#TBL  BYTAB    SMAXOUT,0
SB:XTBL  BYTAB    SMAXOUT,0
SB:WST   BYTAB    SMAXOUT,0
S:OSS    DATA     0                 OUTSWAPSIZE
S:PRPC   DATA     0
S:FPL    RES      0                 SHARES SPACE WITH S:BDA,SH:EDA,S:BCL,S:ECL
         DEF      S:FPL,S:PRPC
S:BDA    WORTAB   SMAXOUT,0
SH:EDA   HAFTAB   SMAXOUT,0         END DISA ADDR
S:BCL    WORTAB   SMAXOUT,0         BEG OF COMMAND LIST
S:ECL    WORTAB   SMAXOUT,0         END OF COMMAND LIST
         BOUND    8
SB:FPN   RES      0
SB:FPL   RES      0                 OVERLAP S:BECL
S:BECL   EQU      %                 BEG & END CL ADDRESSES
         DO       SMAXOUT
         DATA     0,0
         FIN
         BOUND    8
         DO       RDCK
RDCKDSP1 EQU      15
RDCKDSP2 EQU      255
RDCKDSP3 EQU      511
RDCKDSP4 EQU      1023
         FIN
SEEK     EQU      X'03'
SENSE    EQU      X'04'
READ     EQU      X'02'
AJFLGS   EQU      X'2C'
JFLGS    EQU      X'4C'
S:SCL    EQU      %
         DO       MONSIM
PROCSIZE EQU      1
         ELSE
PROCSIZE EQU      30  K
         FIN
I        DO       2*PROCSIZE
         GEN,8,24 SEEK,BA(SH:SDA)+2*(I-1)
         GEN,8,24 X'2E',2
         GEN,8,24 READ,BA(0)
         GEN,8,4,20  X'2C',8,4*512
         FIN
SCL%END  EQU      %
         DATA     0                 WORD FOR TIC
         BOUND    8
SH:SDA   EQU      %
         RES      X'44'
SDA%END  EQU      HA(SH:SDA)+(2*PROCSIZE)-1
         BOUND    4
         BOUND    8
S:JCL    EQU      %
        GEN,8,24 SEEK,BA(SH:JAJDA) CL FOR AJIT IF EXISTS, OTHERWISE JIT
         GEN,8,24 X'2E',2
         GEN,8,24 READ,BA(0)
         GEN,8,4,20  AJFLGS,8,4*512
         GEN,8,24 SEEK,BA(SH:JAJDA)+2  CL FOR JIT IF AJIT EXISTS
         GEN,8,24 X'2E',2
         GEN,8,24 READ,BA(0)
         GEN,8,4,20  JFLGS,8,4*512
SH:JAJDA DATA,2   0,0               DA TABLE FOR JIT CL
         BOUND    4
CHNMSK   DATA     X'FF00007F'
C0MSK    DATA     X'C0000000'
         DO1      RDCK
DORDCK     DATA       0          TURN OFF SWAPPER READ CHECK
DOWTCK   DATA     0                 DFAULT IS NO SWAPPER CHECKWRITE
BANPMC   GEN,21,11  NPMC,0          BA OF NO PG
         BOUND    8
SCLLIM   DATA     S:SCL
         DATA     SH:SDA
TSC0     DATA     0                 TEMPORARY SWAPPER CELL 0
TSC1     DATA     0                 TEMPORARY SWAPPER CELL 1
TSC2     DATA     0                 TEMPORARY SWAPPER CELL 2
TSC3     DATA     0
TSC4     DATA     0
S:JSP    DATA     0                 (JIT SECTOR POS + SDLAY) /2
*  COULD USE SB:HPP OR TSCO FOR THE ABOVE
         PAGE
*
*   MISC STUFF
*
         DEF      M:OC
M:OC     DATA     X'200003',X'68100'
         DATA,1   255,,,            GIVE IT SOME RETRIES
         DO1      11
         DATA     0
         DO       1-SYSGEN
         DEF      AVRID
AVRID    HAFTAB   6
         FIN
S:MBSF   DATA     0
SPOOL    DATA     0
         BOUND    8
BUFLIMS  EQU      %
SCBPOOLIM EQU     0
         DATA     CPOOL,CPOOLEND
MPOOLIM  EQU      1
         DATA     MPOOL,CPOOL-1
S:C2SEEK DATA     0
S:#SWAP%DEV  DATA 0
S:IOEA%ADR DATA   0
S:SECTOR DATA     0
         DEF      SL:IOTA
         DEF      S:CUP
         DEF      SH:PINC
         DEF      S:RTIR
         DEF      SNSTS
         DEF      S:PRIODEC
         DEF      S:RTCORE
         DEF      S:RTUN
*
S:PRIODEC DATA    1                 PRIORITY DECREMENT
S:CUP    DATA     X'FF'             CURRENT USER PRIORITY
S:RTIR   DATA     X'00000000'       REAL TIME IN AND READY FLAG
S:RTCORE DATA     0                 TOTAL SIZE OF R-T USERS LOCKED IN
*                                    CORE
S:RTUN   DATA     0                 REAL TIME USER #
SL:IOTA  DATA     2                 I/O TIME ALLOWANCE (DING)
         DEF      SL:SQPB           PRIO BOOST FOR INTERRUPT AFFTER SQNT
         DEF      SL:SQNT           THRESHOLD AT WHICH TO EXPEDITE USER
SL:SQPB  DATA     2                 BOOST TWO NOTCHES
SL:SQNT  DATA     150               300 MS
*                                   TO ENFORCE CORE QUANTUM FOR I/O
         PAGE
         DEF      S:BADFLG
S:BADFLG DATA     0
*
*        S:BADFLG IS CELL CONTAINING ONE BIT FLAGS
*        REPRESENTING THE OCCURRENCE OF EVENTS WHICH
*        MAY BE OF INTEREST IN THE ANALYSIS OF A CRASH DUMP
*
*        BIT      MEANING
*        ---      -------
*         0       REAL-TIME ACTIVITY; INTERRUPTS CONNECTED
*         1       REAL-TIME LOCK IN CORE
*         2       REAL-TIME LOCK IN CORE ABORT
*         3       SINGLE USER ABORT
*
*        ALL OTHERS CURRENTLY UNDEFINED AND SHOULD REMAIN ZERO
*
         PAGE
         DO       1-SYSGEN
*************************************
*        USER TABLES                *
*************************************
         DEF      UB:JIT
         DEF      UH:FLG
         DEF      UH:JIT
         DEF      UH:AJIT
         DEF      UB:PCT
         DEF      UB:APR
         DEF      UB:APO
         DEF      UB:ASP
        DEF      UB:US
        DEF      UB:FL
         DEF      U:MISC
         DEF      UB:TS
         DEF      UB:DB
         DEF      UB:OV
         DEF      UB:BL
         DEF      UH:ID
UB:DB    BYTAB    SMUIS
UB:OV    BYTAB    SMUIS
UB:US    BYTAB    SMUIS             USERS CURRENT STATE
UB:FL    EQU      %                 LINK TO NEXT USER IN STSTE
         DATA,1   0
I        DO SMUIS-2
         DATA,1   I+1
         FIN
         DATA,1   0
         BOUND    4
UB:BL    EQU      %                 LINK TO PREVIOUS USER IN STATE
         DATA,1   0
I        DO SMUIS-1
         DATA,1   I-1
         FIN
         BOUND    4
UB:JIT   BYTAB    SMUIS             JITS PAGE NO
UB:TS    BYTAB    SMUIS             TIME INTO SHOT
         PAGE
* UH:FLG |---------------------------------|
*        |        |       |    1 1|1 1 1 1 |
*        | 0 1 2 3|4 5 6 7|8 9 0 1|2 3 4 5 |
*        |-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
*            |   |   |   |   |   |   |   |
*            |   |   |   |   |   |   |   > READY -READY TO RUN
*            |   |   |   |   |   |   | > BRKREC-BREAK RECEIVED
*            |   |   |   |   |   |   > ECREC -EC RECEIVED
*            |   |   |   |   |   | > ABORT -JOB TO BE ABORTED
*            |   |   |   |   |   > PPSWAP-PURE PROCEDURE MUST BE SWAPPED
*            |   |   |   |   | > UBRKC -USER HAS BREAK CONTROL
*            |   |   |   |   > DELIC -DELTA IS IN CONTROL
*            |   |   |   | > TELIC -TEL IS IN CONTROL
*            |   |   |   > BATJOB-JOB IS A BATCH JOB
*            |   |   | > JITIC -JIT IS IN CORE
*            |   |   > DELASS-DELTA IS ASSOCIATED
*            |   | > INIT  -INITIALIZATION MUST BE DONE
*                 > SPEC. JIT ACCESS
*               > DCBS - 2NITIAL DCBS ARE BEING SWAPPED IN
UH:FLG   HAFTAB   SMUIS             FLAGS FOR USER
U:MISC   WORTAB   SMUIS             MISC TABLE. USE DEPENDS ON USER STATE
UB:APR   BYTAB    SMUIS             ASSOC. PROC ROOT
UB:APO   BYTAB    SMUIS             ASSOC. PROC OVERLAY
UB:ASP   BYTAB    SMUIS             ASSOC. SPECIAL PROC
UB:PCT   BYTAB    SMUIS             USER PAGE COUNT
UH:JIT   HAFTAB   SMUIS             USERS JIT DISC ADR
UH:AJIT  HAFTAB   SMUIS             ADDITIONAL JITS DISC ADR
UH:ID    HAFTAB   SMUIS             USER'S SYSTEM ID
         FIN
         PAGE
SNSTS    EQU      31
*
* Q HEADS AND TAILS
*
         DEF      SB:HQ,SB:TQ
         REF      MING
         BOUND    8
SB:HQ    DATA     0,0,0,0,0,0,0
         GEN,16,8,8 0,MING,0
         BOUND    8
SB:TQ    DATA     0,0,0,0,0,0,0
         GEN,16,8,8 0,SMUIS,0
         DEF      REG1PSD
NRSRC    EQU      17
SB:RQ    EQU      %
         BYTAB    NRSRC
         DEF      SB:RQ
         REF      REG1
         DEF      LOSTUSER,RCVUSER
         DEF      S:EVF
S:EVF    DATA     0                 EVENT RE-ENTRANCY COUNTER
         BOUND 8
         DEF      REGIPSD
         REF      T:IOREG           ENTRYPOINT IN SSS
REGIPSD  DATA     0,0
         GEN,12,20 X'004',T:IOREG   MASTER,MAPPED AT T:IOREG
         DATA     X'17000000'       DISABLED,WK=01
REG1PSD  DATA     0,0
         GEN,12,20  X'004',REG1     MASTER,MAPPED
         DATA     X'17000000'       DISABLES
LOSTUSER DATA     0
RCVUSER  DATA     0
         PAGE
*
*
*        SITUATIONAL PRIORITY INCREMENTS
*
*
SH:PINC  DATA,2   0                 COMPUTE
         DATA,2   3                 SPECIAL COMPUTE
         DATA,2   2                 I/O COMPLETE
         DATA,2   6                 INTERACTIVE
SSDATSZ  EQU      %-SSDAT
         DEF      S:LAST
S:LAST   EQU      %
         END

