         PCC      0
         TITLE    'CSEX560  -  XEROX 560 SPECIFIC CODE'
         DEF      CSEX560:
CSEX560: EQU      %
         SYSTEM   UTS
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
         TITLE    'CSEX560  -  REFS AND DEFS'
*   REFS TO MODULE TABLES (CSE DATABASE)
         SPACE
         REF      CSED%BEST%END,CSED%PSD,CSED%LOG%MFI
         REF      CSED%PATH,CSED%PSD%I56,CSED%MAPPED
         REF      CSED%SPDF,CSED%RTRY%CNT
         SPACE
         REF      Y1,Y004
         REF      ERRLOG,LMA,T:XMMC,S:CUN
         SPACE
*   REFS TO X560 SPECIFIC DATA IN M:CPU
         SPACE
         REF      CSED%BP%STATUS,CSED%MI%STATUS,CSED%PSTAT
         REF      CSED%PROC%ADDR,CSED%PROC%CNTL,CSEP%PROC%SIZE
         SPACE
         REF      CSEP%PSTAT%SZE
         SPACE
*   REFS TO ITEMS IN MODULE CSEHAND
         SPACE
         REF      CSEI%PATH%PPOL,CSEI%PATH%I56
         REF      CSEP%WHY%T4C,CSEP%WHY%PFI
         REF      CSEP%WHY%BAD%RBLK,CSEP%WHY%WLPE,CSEP%WHY%MAP
         SPACE
         REF      CSE%END
         SPACE
*   EQU'S FOR ITEMS SPECIFIC TO XEROX 560
         SPACE
*   PROCESSOR TYPE CODES AND ADDRESSES
         SPACE
CSEP%BP  EQU      1                 TYPE CODE FOR BP
CSEP%BP%ADDR  EQU  X'05'            PPOLR ADDRESS FOR BP
CSEP%MI  EQU      2                 TYPE CODE FOR MI IN BP'S CLUSTER
CSEP%MI%ADDR  EQU  X'06'            ADDDRESS OF MI IN BP'S CLUSTER
         SPACE
*   ITEMS IN BP POLR STATUS
         SPACE
CSEP%MIE EQU      X'100'            MI ERROR FLAG
CSEP%RBLK%PEBIT  EQU  X'4000'
CSEP%BP%RETRY EQU  X'10'
         SPACE
*   ITEMS IN MI POLR STATUS
         SPACE
CSEP%MAPPE  EQU  X'4000'            MAP PARITY ERROR (OR ACCESS CODES)
         SPACE
*   ITEMS IN MIOP POLR STATUS
         SPACE
CSEP%MIOP%CME  EQU  X'3000'         CONTROL CHECK FAULT & CONTROL MEM FAULT
CSEP%MIOP%SACME  EQU  X'800'        SIGMA ADAPTER CONTROL MEM FAULT
         SPACE
*   REFS TO ROUTINES IN OTHER CSE MODULES
         SPACE
         REF      CSE%BEST%END%SCREECH,CSE%BEST%END%ABORT%STEP  (HAND)
         REF      CSE%BEST%END%STOP          (HAND)
         REF      CSE%LOG%PRIMARY%PFI  (COM)
         REF      CSE%MFIX%ENTRY2   (COM)
         REF      CSE%T4C%FIX%MAP
         REF      CSE%MFIX
         SPACE
CSE%MPOLR  EQU    CSE%2
CSE%MLOG   EQU    CSE%4
CSE%MDEL   EQU    CSE%6
         SPACE
         REF      CSE%2
         REF      CSE%4
         REF      CSE%6
         SPACE
         DEF      CSE%PFI           PRIMARY ENTRY POINTS
         SPACE
*   BRANCH TABLE DEFS AND EQUS
         SPACE
         DEF      CSE%1:560,CSE%3:560,CSE%5:560
         DEF      CSE%7:560,CSE%A:560
         DEF      CSE%B:560,CSE%C:560,CSE%D:560,CSE%E:560,CSE%F:560
         SPACE
CSE%1:560  EQU    CSE%PPOLR         PROCESSOR POLLING
* CSE%2:560 IS DEF'D IN CSECOM
CSE%3:560  EQU    CSE%PLOG          PROC POLL LOGGING
* CSE%4:560 IS DEF'D IN CSECOM
CSE%5:560  EQU    CSE%PDEL          PROC POLL TABLE CLEARING
* CSE%6:560 IS DEF'D IN CSECOM
CSE%7:560  EQU    CSE%MFIX%ENTRY
* CSE%8:560 IS DEF'D IN CSECOM
* CSE%9:560 IS DEF'D IN CSECOM
CSE%A:560  EQU    CSE%T4C%FIX
CSE%B:560  EQU    DUMMY             ENTRY NOT USED
CSE%C:560  EQU    DUMMY             ENTRY NOT USED
CSE%D:560  EQU    DUMMY             ENTRY NOT USED
CSE%E:560  EQU    DUMMY             ENTRY NOT USED
CSE%F:560  EQU    DUMMY             ENTRY NOT USED
         SPACE
         TITLE    'CSEX560  -  CSE%MFIX%ENTRY'
         SPACE
*   ENTER WITH BAL,R14
*        R3 CONTAINS ADDRESS OF MEMORY CELL WITH BAD PARITY
*        R1 CONTAINS ADDRESS OF MSTAT ENTRY WORD 0
*        USES R9 AND SETS R8 IF ERROR FOUND IS CORR PE (X560)
         SPACE
CSE%MFIX%ENTRY  EQU  %
         MTW,1    CSED%LOG%MFI      ALWAYS LOG MEM ERRORS ON X560
         LW,R9    1,R1              PICK UP MSW0 (MSTAT ENTRY WORD 1)
         CW,R9    =X'40000001'      CHECK FOR POWER FAIL, MULT ERR BITS
         BAZ      CSEM1A            B/ NOT SET OK TO CONTINUE
         BAL,R14  CSE%MFIX%ENTRY2   GO SET STOP SEQUENCE
CSEM1A   EQU      %
         DO       0                 NEEDED FOR BI-POLAR MEMORY ONLY
         CI,R9    X'200'            CHECK FOR CORRECTED PE
         BAZ      CSEM1             B/ NOT SET
         AI,R8    -1                TO AVOID SCREECH IF THIS IS ONLY ERROR
         B        *R14              RETURN
         FIN
CSEM1    EQU      %
         CI,R9    X'10'             CHECK FOR WRITE LOCK PE
         BAZ      *R14              B/ NOT WL PE RETURN
         PUSH     16,R0             SAVE OUR REGS
         BAL,R4   LMA               GO LOAD WL,MAP, & ACC
         LW,R11   S:CUN             LOAD MAP FOR CURRENT USER
         BAL,R11  T:XMMC
         PULL     16,R0             GET BACK OURS
         MTW,-1   CSED%RTRY%CNT     DECREMENT RETRY COUNTER
         BGZ      *R14              RETURN TO RETRY
         LI,R11   CSEP%WHY%WLPE     SET WHY CODE
         BAL,R12  CSE%BEST%END%STOP
         B        *R14              RETURN
         TITLE    'CSEX560  -  CSE%PPOLR'
CSE%PPOLR  EQU    %
         SPACE
*   PROCESSOR POLLING ROUTINE FOR XEROX 560
         SPACE
         LI,R3    CSEI%PATH%PPOL
         STS,R3   CSED%PATH         SET FOR REENTRY CHECK
         LI,R7    CSEP%BP%ADDR      ADDRESS OF BP UNIT
         LI,R8    CSEP%BP           TYPE CODE OF BP
         BAL,R14  CSEP              GO POLL BP
         BCS,1    CSEP1             NO STATUS
         STW,R9   CSED%BP%STATUS    PUT STATUS IN TABLE (WORD 0)
CSEP1    LI,R7    CSEP%MI%ADDR      ADDRES OF MI UNIT (CLUSTER 0)
         LI,R8    CSEP%MI           TYPE CODE OF MI UNIT
         BAL,R14  CSEP              GO POLL MI
         BCS,1    CSEP2
         STW,R9   CSED%MI%STATUS    STORE IN TABLE (WORD 1)
CSEP2    LI,R1    0                 INDEX TO CONFIG TABLE
         LI,R2    1                 INDEX TO PSTAT TABLE (STARTS @ WORD 2)
CSEP3    EQU      %
         LB,R7    CSED%PROC%ADDR,R1 GET ADDRESS
         LB,R8    CSED%PROC%CNTL,R1 GET TYPE
         BAL,R14  CSEP              GO POLL THIS UNIT
         BCS,1    CSEP5             B/ NO STATUS THIS UNIT
CSEP4    AI,R2    1                 BUMP UP INDEX IN PPOLR TABLE
         CI,R2    CSEP%PSTAT%SZE    COMPARE W/ MAX INDEX
         BG       CSEP5             TABLE FULL , JUST POLL
         MTW,0    CSED%PSTAT,R2     CHECK IF THIS ENTRY USED
         BLZ      CSEP4             TRY NEXT
         STW,R9   CSED%PSTAT,R2     STORE STATUS IN TABLE
CSEP5    EQU      %
         AI,R1    1                 NEXT PROCESSOR
         CI,R1    CSEP%PROC%SIZE    MAXIMUM PROC INDEX
         BLE      CSEP3             GO DO NEXT
         LI,R2    0                 ALL DONE
         STS,R2   CSED%PATH         ALL DONE , RESET BIT (IN R3)
         B        *R15
         SPACE
CSEP     EQU      %                 ACTUAL POLL ROUTINE
         SLS,R7   8
         POLR,R9  0,R7              GET STATUS
         STCF     R7                TEMP SAVE OF CC
         CI,R8    CSEP%BP           SEE IF THIS IS BP
         BNE      CSEP6             B/ NO, DO REGULAR CC CHECK
         CI,R9    0                 BP RETURNS ZERO IS NO FAULTS
         BEZ      CSEP8             NO FAULTS , RETURN WITH CC4=1
         B        CSEP7
CSEP6    LCF      R7                GET POLR CC
         BCS,8    CSEP8             B/ ADDRESS NOT RECOGNIZED
         BCR,4    CSEP8             DID NOT RAISE PFI, THEREFORE NO STATUS
CSEP7    STCF     R8                SAVE CC
         SLD,R8   -4                MOVE IN TYPE CODE
         SLS,R8   -24               POSITION CC
         SLD,R8   -4                MOVE IN CC
         LW,R8    R7                GET ADDRESS
         SLS,R8   -8                MOVE ADDRES OVER
         OR,R8    X80               SET USED BIT
         SLD,R8   -8                MOVE THEM IN
         LCI      0                 INDICATE VALID STATUS
         B        *R14              RETURN
CSEP8    LCI      1                 INDICATE NO FAULT STATUS
         B        *R14
         TITLE    'CSEX560  -  CSE%PLOG'
CSE%PLOG  EQU  %
         LW,R8    =X'32030000'      CODE AND COUNT
         LI,R6    R8                ADDRESS OF BUFFER
         OR,R6    Y1
         LI,R1    -CSEP%PSTAT%SZE-1  INDEX TO CSED%PSTAT
CSPL1    LW,R10   CSED%PSTAT+CSEP%PSTAT%SZE+1,R1   PICK UP ENTRY
         BGEZ     CSPL2             EMPTY, TRY NEXT (B0 NOT SET)
         BAL,R5   ERRLOG
CSPL2    CI,R1    CSEP%PSTAT%SZE
         BGE      *R15              ALL DONE QUIT
         BIR,R1   CSPL1             INCREMENT , GO BACK FOR MORE
         TITLE    'CSEX560  -  CSE%PDEL'
CSE%PDEL EQU      %                 ZERO OUT PSTAT TABLE
         LI,R1    -CSEP%PSTAT%SZE-1
         LI,R0    0
CSPD1    STW,R0   CSED%PSTAT+CSEP%PSTAT%SZE+1,R1
         CI,R1    CSEP%PSTAT%SZE
         BGE      *R15              ALL DONE, RETURN
         BIR,R1   CSPD1             GO BACK , DO MORE
         TITLE    'CSEX560  -  CSE%T4C%FIX'
CSE%T4C%FIX  EQU  %
         LI,R1    CSEP%MIE          MI ERROR BIT
         CW,R1    CSED%BP%STATUS    IN BP STATUS
         BANZ     CS4C1             B/ MIE FLAG SET, CHECK MI STATUS
         LI,R1    CSEP%RBLK%PEBIT   CHECK FOR REG P.E.
         CW,R1    CSED%BP%STATUS    IN BP STATUS
         BAZ      CSABORT           NOT R-BLK PARITY
         B        CSE%T4C%RBLOCK
CS4C1    EQU      %
         LI,R1    CSEP%MAPPE        MAP PE BIT IN...
         CW,R1    CSED%MI%STATUS    MI STATUS (CLUSTER 0)
         BANZ     CSE%T4C%FIX%MAP   GO RELOAD MAP AND ACC CODES
CSABORT  EQU      %
         LI,R11   CSEP%WHY%T4C      WHY CODE
         B        CSABRT1           GO ABORT STEP
         SPACE
         SPACE
CSE%T4C%RBLOCK      EQU %
         LI,R11   CSEP%WHY%BAD%RBLK SET WHY CODE
CSABRT1  EQU      %
         BAL,R12  CSE%BEST%END%ABORT%STEP
         B        *R15
         TITLE    'CSEX560  -  CSE%PFI'
CSE%PFI  EQU      %
         PUSH     16,R0             SAVE REG BLOCK 0 IN TSTACK
         LI,R1    CSEI%PATH%I56
         STW,R1   CSED%PATH         SET PATH BIT FOR REENTRY DETECTION
         LI,R1    0
         STW,R1   CSED%BEST%END     ZERO OUT ABORT FLAG
         SPACE
         BAL,R15  CSE%PPOLR         PROCESSOR POLLING
         BAL,R15  CSE%MPOLR         MEMORY POLLING
         BAL,R15  CSE%MFIX          LOOK AT MEMORY STATUS
         BAL,R15  CSE%LOG%PRIMARY%PFI  GO LOG PRIMARY RECORD
         BAL,R15  CSE%PLOG          LOG POLR SECONDARIES
         BAL,R15  CSE%MLOG          LOG MEM SECONDARIES
* CSE%PFIX  -  LOOP THRU PSTAT TABLES LOOKING AT ENTRIES
         LI,R2    0
CSPFI1   LW,R0    CSED%PSTAT,R2     IS THIS ENTRY USED
         BGEZ     CSPFI3            B/ NO, TRY NEXT
         SLS,R0   12                ISOLATE CODE
         SLS,R0   -28
         CI,R0    X'02'             IS IT MIOP
         BE       CSE%PFI%MIOP      B/ YES, GO CHECK STATUS
*        CI,R0    X'05'             IS IT RMP
*        BE       CSE%PFI%RMP       B/ YES, GO CHECK STATUS
         CI,R0    X'01'             IS IT BP
         BNE      CSPFI3            B/ NOT BP, JUST LOG IT
         LI,R1    CSEP%BP%RETRY        IS IT CORRECTED RETRY
         CW,R1    CSED%PSTAT,R2
         BANZ     CSPFI4            B/ YES, CONTINUE LOOKING
CSPFI2   LI,R11   CSEP%WHY%PFI      SET WHY CODE
         BAL,R12  CSE%BEST%END%SCREECH  SCREECH ON MI, AND UNCORRECTED BP
         B        CSPFI4
CSPFI3   CI,R0    X'02'             NOT BP,MIOP,RMP, IS IT MI
         BE       CSPFI2            B/ YES, SCREECH
CSPFI4   EQU      %
         CI,R2    CSEP%PSTAT%SZE    CHECK IF LAST ENTRY
         BGE      CSPFI5            ALL DONE, QUIT LOOPING
         BIR,R2   CSPFI1            GO BACK TO NEXT
CSE%PFI%MIOP  EQU  %
         LI,R1    CSEP%MIOP%CME+CSEP%MIOP%SACME
         CW,R1    CSED%PSTAT,R2     CHECK FOR CONTROL MEMORY ERRORS
         BAZ      CSPFI4            NOT CME, OK TO CONTINUE
CSE%PFI%RIO  EQU  %
         LW,R1    CSED%PSTAT,R2     PICK UP STATUS
         SLS,R1   4
         SLS,R1   -20               POSITION PROC ADDRESS
         RIO,0    0,R1              RIO TO PROCESSOR (MIOP)
         BCR,X'E' CSPFI4            B/ RIO ACCEPTED
         B        CSPFI2            SET SCREECH FLAG
CSPFI5   EQU      %
         MTW,0    CSED%BEST%END     CHECK ERROR LEVEL
         BNEZ     CSPFI6            B/ ERROR, USE CSE EXIT
         BAL,R15  CSE%PDEL          ZERO OUT PSTAT TABLE
         BAL,R15  CSE%MDEL          ZERO OUT MSTAT TABLE
         LI,R0    0
         LI,R1    CSEI%PATH%I56
         STS,R0   CSED%PATH         RESET PATH BITS
         PULL     16,R0             RESTORE REGS
         LPSD,X'B'  CSED%PSD%I56    GO BACK TO INTERRUPT POINT
         SPACE
CSPFI6   EQU      %
         LI,R0    0
         STW,R0   CSED%MAPPED       RESET  MAPPED FLAG
         STW,R0   CSED%SPDF         RESET RENTRY FLAG
         LD,R0    CSED%PSD%I56      PICK UP PSD
         STD,R0   CSED%PSD
         CW,R0    Y004              CHECK MAP BIT
         BAZ      CSE%END           GO EXIT
         MTW,1    CSED%MAPPED       SET MAPPED FLAG
         B        CSE%END           GO EXIT
         SPACE
*   BAD ENTRY INTO BRANCH TABLE
         SPACE
DUMMY    EQU      %
         SCREECH  X'23'             .23
         END

