*M*      CSES9    SIGMA 9 SPECIFIC CODE FOR CENTRAL SYSTEM ERRORS
*P*  NAME:  CSES9
*P*  PURPOSE:  PROVIDE MACHINE SPECIFIC CODE FOR HANDLING
*P*            HARDWARE FAULTS ON SIGMA 9.  USED IN CONJUNCTION
*P*            WITH CSEHAND AND CSECOM MODULES.
*P*
*P*  DESCRIPTION:  SEE CSEHAND MODULE FOR OVERVIEW OF FAULT HANDLING
         PCC      0
         TITLE    'CSES9  -  SIGMA 9 SPECIFIC CODE'
         DEF      CSES9:
CSES9:   EQU      %
RAWORKS  SET      1                 JUST IN CASE THEY FIX IT ????
RAWORKS  SET      0                 BECAUSE IT DOESN'T WORK
BITS     SET      1                 GET BT31TO0 BITS
         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
         PAGE
*    REFS AND DEFS
         SPACE
         REF      CSE%BEST%END%STOP ROUTINE TO SET STOP FLAG
         REF      CSE%BEST%END%ABORT%STEP ROUTINE TO SET ABORT FLAG
         REF      CSE%MFIX%ENTRY2   ROUTINE TO SET MPE AND STOP FLAGS
         REF      CSE%T4C%FIX%MAP   ROUTINE TO RELOAD MAP AND ACC
         DO1      RAWORKS
         REF      CSE%RA%TST        TEST REGISTER ALTERED FLAG
         REF      CSED%CF           TRAP CC AND FLOATING CONTROLS
         REF      CSED%RTRY%CNT     COUNTER FOR RETIES
         SPACE
*   DEFS FOR CSE BRANCH TABLE
         SPACE
         DEF      CSE%1:9           CSE BRANCH TARGET #1
         DEF      CSE%3:9           CSE BRANCH TARGET #3
         DEF      CSE%5:9           CSE BRANCH TARGET #5
         DEF      CSE%7:9           CSE BRANCH TARGET #7
         DEF      CSE%A:9           CSE BRANCH TARGET #10
         DEF      CSE%C:9           CSE BRANCH TARGET #12
         DEF      CSE%D:9           CSE BRANCH TARGET #13
         DEF      CSE%E:9           CSE BRANCH TARGET #14
         DEF      CSE%F:9           CSE BRANCH TARGET #15
         SPACE
         SPACE
CSE%1:9  EQ       CSE%PPOLR
* CSE%2:9 IS DEF'D IN CSECOM
CSE%3:9  EQ       CSE%PLOG
* CSE%4:9 IS DEF'D IN CSECOM
CSE%5:9  EQ       CSE%PDEL
* CSE%6:9 IN DEF'D IN CSECOM
CSE%7:9 EQ        CSE%MFIX%ENTRY
* CSE%8:9 IS DEF'D IN CSECOM
* CSE%9:9 IS DEF'D IN CSECOM
CSE%A:9 EQ        CSE%T4C%FIX
* CSE%B:9 IS DEF'D IN CSECOM
CSE%C:9  EQ       DUMMY             ENTRY NOT USED
CSE%D:9  EQ       DUMMY             ENTRY NOT USED
CSE%E:9  EQ       DUMMY             ENTRY NOT USED
CSE%F:9  EQ       DUMMY             ENTRY NOT USED
         SPACE
CSEP%WHY%T4C  EQU  3                X'4C' TRAP (MISC CAUSE)
         PAGE
*   THIS ROUTINE CONTAINS ALL THE SIGMA 9 SPECIFIC CODE
*   FOR THE HARDWARE FAULT HANDLERS
         SPACE
CSE%PPOLR  EQU  %                   PROCESSOR POLLING
         CI,4     0
         BE       *15
         HIO,0    X'C000',4         DO A POLR TO IOP THAT HAD
         B        *15               THE BUS CHECK.
CSE%PLOG  EQU  %
CSE%PDEL  EQU  %
         B        *R15              NOT USED ON SIGMA 9
         SPACE
*F*  NAME:  CSE%MFIX%ENTRY   (CSE BRANCH TABLE ENTRY#7)
*F*
*F*  PURPOSE:  EXAMINES SIGMA 9 FORMAT OF MEMORY BANK STATUS
*F*            TO FORM ENTRY IN C%MSTAT TABLE FOR ERROR LOGGING
         SPACE
CSE%MFIX%ENTRY    EQU    %
         SPACE
*   ENTER WITH BAL,R14
*        R2 - ADDRESS OF MEMORY CELL WITH BAD PARITY
*        R1 - ADDRESS OF MPOLR ENTRY WORD ZERO
*        CANNOT USE R0,R4,R8
         SPACE
         LCI      8                 PICK UP MSW 0 (AGAIN)
         LMS,R11  0,R2              IN ORDER TO CHECK
         CW,R11   Y01               FOR POWER FAIL BIT AFTER RESETTING
         BAZ      CSE%CALC%REAL%ADR OK TO CONTINUE
         BAL,R13  CSE%MFIX%ENTRY2   COMMON CODE TO SET STOP
*
CSE%CALC%REAL%ADR  EQU  %
*        REAL ADDRESS IS CALCULATED
*        FROM INTERLEAVING INFO IN MSW'S
         SPACE
         LW,R10   3,R1              PICK UP MSW2 (INTER. ADDR)
         LI,R7    X'4001'           ASSUME 2-WAY INTERL
         LW,R13   2,R1              PICK UP MSW1
         LCF      R13               PICK UP INTERL. INFO
         BCR,X'C'     *R14          B/ NOT INTERLEAVED, RETURN
         BCS,X'4'     CSIN1         B/ 2 WAY INTER
         LI,R7    X'8001'           SET 4-WAY BITS
         BAL,R13  CSIN2             DO FIRST BIT PAIR
         LI,R7    X'4002'           SET SECOND BIT PAIR
CSIN1    BAL,R13  CSIN2
         B        *R14              ALL DONE, RETURN
CSIN2    CW,R10   R7
         BAZ      *R13              B/ MUST BE 0 0
CSIN3    EOR,R10  R7
         CW,R10   R7
         BAZ      CSIN3             B/ MUST BE 1 1 (PUT BACK)
         B        *R13              MUST BE 0 1 OR 1 0
         SPACE
*F*  NAME:  CSE%T4C%FIX   (CSE BRANCH TABLE ENTRY#10)
*F*
*F*  PURPOSE:  CHECK FOR MAP ERROR, SET WHY CODE TO GENERAL
*F*            X'4C' OR BRANCH TO MAP RECOVERY ROUTINE.
*F*            SETS ABORT JOB STEP (SCREECH) FLAG, OR IF
*F*            RETRIES ARE EXHAUSTED SETS HALT FLAG.
         SPACE
CSE%T4C%FIX  EQU  %
         LC       CSED%CF
         BCS,X'4' CSE%T4C%FIX%MAP   MAP ERROR GO RELOAD MAP AND ACCESS CODES
         LI,R11   CSEP%WHY%T4C      IN CASE RA TEST FAILS
         MTW,-1   CSED%RTRY%CNT
         DO       RAWORKS
         BGZ      CSE%RA%TST        RETRY IF RA NOT SET
         ELSE
         BGZ      CSEASTEP          GO ABORT USERS STEP
         FIN
         BAL,R12  CSE%BEST%END%STOP RETRIES FAILED
         B        *R15
CSEASTEP  BAL,R12 CSE%BEST%END%ABORT%STEP
         B        *R15
         SPACE
DUMMY    EQU      %
         SCREECH  X'23'             .23 BAD CSEBRANCH ENTRY
*S*  SCREECH CODE:  23-00
*S*
*S*  MESSAGE:  INVALID ENTRY TO CSE HANDLERS
*S*
*S*  REPORTED BY:  CSES7,CSES9,CSEX560
*S*
*S*  TYPE:  SCREECH
*S*
*S*  REMARKS:  ENTRY WAS MADE TO AN UNUSED SLOT OF THE CSE
*S*            BRANCH VECTOR FOR THIS MACHINE TYPE.
*S*
*S*  REGISTERS:  NONE SIGNIFICANT
         END

