Annotation of cci/d/event/init.x, revision 1.1.1.2

1.1       root        1: 
                      2: /*     init.s                                                          */
                      3: 
                      4: 
                      5: /*     This file is a diagnostic version of locore.s.                  */
                      6: /*     It contains the following:                                      */
                      7: /*     *system data area = scb, dump buffer, interrupt stack,          */
                      8: /*     *system page table,user page tables,pcbs,iomap, & io buffers.   */
                      9: /*                                                                     */
                     10: /*     *system code = interrupt vectors, initialization of system data,*/
                     11: /*     *memory size calculation,initialization of SPT, zeroing of      */
                     12: /*     *unused memory, & loading of SBR & SLR.                         */
                     13: /*     *                                                               */
                     14: /*     *at the end of this code, you are ready to go to virtual mode.  */
                     15: /*     * --- GOOD LUCK!                                                */
                     16: /*                                                                     */
                     17: /*     The arithmetic fault test will only be run if there is a        */
                     18: /*     Floating Point Processor in the system or if the users sets the */
                     19: /*     'run arithmetic test' bit (bit 4 -0x10) in register #1.         */
                     20: /*                                                                     */
                     21: /*  14-June-85 : run arithmetic fault test with FPP or option bit set   */
                     22: /*                                                                     */
1.1.1.2 ! root       23: /*     Modified 11/20/85 to include two subtests (9 and A) that        */
        !            24: /*     will generate an alignment fault when the error is in           */
        !            25: /*     the intermediate address of a deferred addressing mode.         */
        !            26: /*                                                                     */
        !            27: /*     Modified 04/22/86 to fix an intermittent failure that occured   */
        !            28: /*     due to clock or console receive interrupts.  The ISP, KSP and   */
        !            29: /*     Usp were seperated throughout the test to solve this problem.   */
        !            30: /*     Before this change the test would fail intermittently when run  */
        !            31: /*     with the printout turned on.  Also added the release date that  */
        !            32: /*     can be read from memory.  The date will be after the jump to    */
        !            33: /*     of test at location 0x800                                       */
1.1       root       34: 
                     35: /*     privileged registers addresses  */
                     36: #include       "prvreg.h"
                     37:        
                     38: /*     program status long word definition     */
                     39: #include       "psl.h" 
                     40: 
                     41: /*     page table entry definition             */
                     42: #include       "pte.h"
                     43:        
                     44: /*     process control block offsets   */
                     45: #include       "pcboffset.h"   
                     46: 
                     47: /*     fundamental constants for globl use     */
                     48: #include       "const.h"       
                     49: 
                     50: /*     system control block offsets*/
                     51: #include       "scboffset.h"
                     52: /*     SPT offsets                             */
                     53: #include       "sptoffset.h"
                     54: 
                     55: /*     trap numbers*/
                     56: #include       "trap.h"        
                     57: 
                     58: 
                     59: #define V_TRAP         0
                     60: #define V_SYSCALL      4
                     61: 
                     62:        .set    HIGH,0x1f       /*mask for disabling all interrupts     */
                     63:        .set    MCKVEC,4        /*scb offset for machinecheck vector    */
1.1.1.2 ! root       64:        .set    NISP,512        /*size of interrupt stack               */
1.1       root       65:        .set    DONE,255        /*user process done code                */
                     66: 
                     67:        .text
                     68: 
                     69: #include "pstorage.s"          /* PROCESSOR STORAGE AREA               */
                     70: 
                     71:        .globl  _Entry
                     72: _Entry:
                     73:        jmp     start
1.1.1.2 ! root       74:        .long 0x00042286        /* date of realese      */
        !            75:        .space  (1024-10)
1.1       root       76: 
                     77: 
                     78: 
                     79: 
                     80: /*             globl dump buffer to be used for communication          */
                     81: /*             between tests & interrupt handlers, & other misc.       */
                     82: /*             purposes.                                               */
                     83:                                
                     84:                                /*physical page 3                       */
                     85: 
1.1.1.2 ! root       86:        .set    NLWU,36         /*no. of longwords already used         */
1.1       root       87:                                /*this must be changed when you define  */
                     88:                                /*additional variables below before     */
                     89:                                /*_dbuf                                 */
                     90:        .globl  _restart
                     91: _restart:
                     92:        .space  4               /*contains restart address for restarting*/
                     93:                                /*after power is restored (loaded by    */
                     94:                                /*power fail interrupt handler & used by*/
                     95:                                /*CPU 2                                 */      
                     96:        .globl  _maxmem
                     97: _maxmem:
                     98:        .space  4               /*memory size in no of bytes            */
                     99: 
                    100:        .globl  _maxpages
                    101: _maxpages:
                    102:        .space  4               /*memory size in no. of physical pages  */
                    103: 
                    104:        .globl  _lastadd
                    105: _lastadd:
                    106:        .space  4               /*address of the last long word         */
                    107: 
                    108:        .globl  _unused
                    109: _unused:
                    110:        .space  4               /*first unused page in system space     */
                    111: 
                    112:        .globl  _ctlblk
                    113: _ctlblk:
                    114:        .long   0               /* pointer to SCB */
                    115: 
                    116:        .globl  _savvec0        /*save vectors area                     */
                    117: _savvec0:
                    118:        .space  4
                    119: 
                    120:        .globl  _savvec1        /*save vectors area                     */
                    121: _savvec1:
                    122:        .space  4
                    123: 
                    124:        .globl  _savvec2        /*save vectors area                     */
                    125: _savvec2:
                    126:        .space  4
                    127: 
                    128:        .globl  _savvec3        /*save vectors area                     */
                    129: _savvec3:
                    130:        .space  4
                    131: 
                    132:        .globl  _savvec4        /*save vectors area                     */
                    133: _savvec4:
                    134:        .space  4
                    135: 
                    136:        .globl  _savvec5        /*save vectors area                     */
                    137: _savvec5:
                    138:        .space  4
                    139:        .globl  _savvec6        /*save vectors area                     */
                    140: _savvec6:
                    141:        .space  4
                    142:        .globl  _savvec7        /*save vectors area                     */
                    143: _savvec7:
                    144:        .space  4
                    145: 
                    146:        .globl  _savvec8        /*save vectors area                     */
                    147: _savvec8:
                    148:        .space  4
                    149: 
1.1.1.2 ! root      150:        .globl  _savvec9        /*save vectors area                     */
        !           151: _savvec9:
        !           152:        .space  4
        !           153: 
        !           154:        .globl  _savveca        /*save vectors area                     */
        !           155: _savveca:
        !           156:        .space  4
        !           157: 
1.1       root      158:        .globl  badrtn
                    159: badrtn:
                    160:        .long   tfail 
                    161: 
                    162: testno: .long  0
                    163: 
                    164:        .globl  _dbuf           /*dump buffer left out of 1K            */
                    165:        .globl  _r_no
                    166: _r_no:
                    167:        .long   0
                    168:        .globl  _pt_base
                    169: _pt_base:
                    170:        .long   0
                    171:        .globl  _saved_psl
                    172: _saved_psl:
                    173:        .long   0
                    174:        .globl  _saved_sp
                    175: _saved_sp:
                    176:        .long   0
                    177:        .globl  _saved_fp
                    178: _saved_fp:
                    179:        .long   0
                    180:        .globl  _p_ptr
                    181: _p_ptr:
                    182:        .long   0
                    183:        .globl  _ret_adr
                    184: _ret_adr:
                    185:        .long   0
                    186:        .globl  _exp_par0
                    187: _exp_par0:
                    188:        .long   0
                    189:        .globl  _exp_par1
                    190: _exp_par1:
                    191:        .long   0
                    192:        .globl  _exp_par2
                    193: _exp_par2:
                    194:        .long   0
                    195:        .globl  _exp_par3
                    196: _exp_par3:
                    197:        .long   0
                    198:        .globl  _act_par0
                    199: _act_par0:
                    200:        .long   0
                    201:        .globl  _act_par1
                    202: _act_par1:
                    203:        .long   0
                    204:        .globl  _act_par2
                    205: _act_par2:
                    206:        .long   0
                    207:        .globl  _act_par3
                    208: _act_par3:
                    209:        .long   0
                    210:        .globl  _test_no
                    211: _test_no:
                    212:        .long   0
                    213:        .globl  _clk_cnt
                    214: _clk_cnt:
                    215:        .long   0               /* Clock int. count */
                    216: _dbuf:
                    217:        .space  NBPG - (NLWU *4)
                    218: edbuf:
                    219: 
                    220: 
                    221:        .globl  _intstack       /* Interrupt stack                      */
                    222: _intstack:                     /* Physical pages 4 & 5                 */
1.1.1.2 ! root      223:        .space  NISP
1.1       root      224: eintstack:
                    225: 
1.1.1.2 ! root      226:        .globl  _usrstack       /* User  stack                  */
        !           227: _usrstack:                     /* Physical pages 6 & 7                 */
        !           228:        .space  NISP
        !           229: eusrstack:
        !           230: 
        !           231:        .globl  _kerstack       /* Kernal stack                 */
        !           232: _kerstack:                     /* Physical pages 8 & 9                 */
        !           233:        .space  NISP
        !           234: ekerstack:
        !           235: 
        !           236:        .globl  _tmpstack       /* temp stack                   */
        !           237: _tmpstack:                     /* Physical pages 8 & 9                 */
        !           238:        .space  NISP
        !           239: etmpstack:
        !           240: 
1.1       root      241: 
                    242:        .set    SYSPTSIZE,512   /* No. of entries in SPT                */
                    243:  
                    244: /*
1.1.1.2 ! root      245:        System Page Table -- physical page 10 & 11
1.1       root      246: */ 
                    247:        .align  2
                    248:        .globl  _Sysmap
                    249: _Sysmap:
                    250:        .space  SYSPTSIZE*4     /* 512 max pages allowed for system     */
                    251: eSysmap:
                    252:        .globl  _Syssize
                    253:        .set    _Syssize,(eSysmap-_Sysmap)/4    /* should be SYSPTSIZE  */
                    254:        
1.1.1.2 ! root      255:        .globl  _iomap          /* Physical page 12     */
1.1       root      256: _iomap:        .space  1024            /* IOMAP - unused       */
                    257:        .globl  _eiomap
                    258: _eiomap:
                    259: 
1.1.1.2 ! root      260:        .globl  _pcb0           /* Physical page 13     */
1.1       root      261: _pcb0: .space  128             /*process control block 0               */
                    262:        .globl  _pcb1
                    263: _pcb1: .space 128              /*process control block 1               */
                    264:        .globl  _pcb2
                    265: _pcb2: .space 128              /*process control block 2               */
                    266:        .globl  _pcb3
                    267: _pcb3: .space 128              /*process control block 3               */
                    268:        .globl  _pcb4
                    269: _pcb4: .space 128              /*process control block 4               */
                    270:        .globl  _pcb5
                    271: _pcb5: .space 128              /*process control block 5               */
                    272:        .globl  _pcb6
                    273: _pcb6: .space 128              /*process control block 6               */
                    274:        .globl  _pcb7
                    275: _pcb7: .space 128              /*process control block 7               */
                    276: 
                    277: /*
                    278:        *user #0 page tables -- P0PT, P1PT, P2PT                        
1.1.1.2 ! root      279:        *physical memory     --  page14, 15, & 16  respectively
1.1       root      280: */
                    281:        .align  2
                    282:        .globl  _u0p0pt
                    283: _u0p0pt:
                    284:        .space  1024            /*255 max pages for user #0 text        */
                    285:        .globl  _u0p1pt
                    286: _u0p1pt:       
                    287:        .space  1024            /*255 max pages for user #0 data        */
                    288:        .globl  _u0p2pt
                    289: _u0p2pt:       
                    290:        .space  1020            /*255 max pages for user #0 stack       */
                    291: eu0p2pt:
                    292:        .space  4
                    293: 
                    294: /*
                    295:        *user #1 page tables -- P0PT, P1PT, P2PT                        
1.1.1.2 ! root      296:        *physical memory     --  page17 ,18, & 19  respectively
1.1       root      297: */
                    298:        .align  2
                    299:        .globl  _u1p0pt
                    300: _u1p0pt:
                    301:        .space  1024            /*255 max pages for user #1 text        */
                    302:        .globl  _u1p1pt
                    303: _u1p1pt:       
                    304:        .space  1024            /*255 max pages for user #1 data        */
                    305:        .globl  _u1p2pt
                    306: _u1p2pt:       
                    307:        .space  1020            /*255 max pages for user #1 stack       */
                    308: eu1p2pt:
                    309:        .space  4
                    310: 
                    311: 
                    312: /*
                    313:        *user #2 page tables -- P0PT, P1PT, P2PT                        
1.1.1.2 ! root      314:        *physical memory     --  page 20, 21 , & 22  respectively
1.1       root      315: */
                    316:        .align  2
                    317:        .globl  _u2p0pt
                    318: _u2p0pt:
                    319:        .space  1024            /*255 max pages for user #2 text        */
                    320:        .globl  _u2p1pt
                    321: _u2p1pt:       
                    322:        .space  1024            /*255 max pages for user #2 data        */
                    323:        .globl  _u2p2pt
                    324: _u2p2pt:       
                    325:        .space  1020            /*255 max pages for user #2 stack       */
                    326: eu2p2pt:
                    327:        .space  4
                    328: 
                    329: 
                    330: /*
                    331:        *user #3 page tables -- P0PT, P1PT, P2PT                        
1.1.1.2 ! root      332:        *physical memory     --  page 23, 24 , & 25  respectively
1.1       root      333: */
                    334:        .align  2
                    335:        .globl  _u3p0pt
                    336: _u3p0pt:
                    337:        .space  1024            /*255 max pages for user #3 text        */
                    338:        .globl  _u3p1pt
                    339: _u3p1pt:       
                    340:        .space  1024            /*255 max pages for user #3 data        */
                    341:        .globl  _u3p2pt
                    342: _u3p2pt:       
                    343:        .space  1020            /*255 max pages for user #3 stack       */
                    344: eu3p2pt:
                    345:        .space  4
                    346: 
                    347: /*
                    348:        *user #4 thru 6 page tables
1.1.1.2 ! root      349:        *physical memory -- pages 26 thru 34
1.1       root      350: */
                    351:        .globl  _u4p0pt
                    352: _u4p0pt:
                    353:        .space  (9*NBPG) - 4
                    354: eu6p2pt:
                    355:        .space  4
                    356: 
                    357: /*
                    358:        *user #7 page tables -- P0PT, P1PT, P2PT                        
1.1.1.2 ! root      359:        *physical memory     --  page 35, 36 , & 37  respectively
1.1       root      360: */
                    361:        .align  2
                    362:        .globl  _u7p0pt
                    363: _u7p0pt:
                    364:        .space  1024            /*255 max pages for user #7 text        */
                    365:        .globl  _u7p1pt
                    366: _u7p1pt:       
                    367:        .space  1024            /*255 max pages for user #7 data        */
                    368:        .globl  _u7p2pt
                    369: _u7p2pt:       
                    370:        .space  1020            /*255 max pages for user #7 stack       */
                    371: eu7p2pt:
                    372:        .space  4
                    373: 
                    374:        .globl  _iob0           /*io buffer 0 */
                    375: _iob0: .space  1024
                    376:        .globl  _iob1           /*io buffer 1 */
                    377: _iob1: .space  1024
                    378:        .globl  _iob2           /*io buffer 2 */
                    379: _iob2: .space  1024
                    380:        .globl  _iob3           /*io buffer 3 */
                    381: _iob3: .space  1024
                    382:        .globl  _iob4           /*io buffer 4 */
                    383: _iob4: .space  1024
                    384:        .globl  _iob5           /*io buffer 5 */
                    385: _iob5: .space  1024
                    386:        .globl  _iob6           /*io buffer 6 */
                    387: _iob6: .space  1024
                    388: esysdata:
                    389: 
                    390: #include "scblock.s"           /* SYSTEM CONTROL BLOCK                 */
                    391: 
                    392: 
                    393: 
                    394: 
                    395: 
                    396: 
                    397: 
                    398: #include       "evthandlers.s" /*event handlers                        */
                    399: 
                    400: #define        ACBL(_n1,_n2,_n3,_n4) \
                    401: addl2  _n2,_n3;\
                    402: cmpl   _n3,_n1;\
                    403: bleq   _n4;
                    404: 
                    405: 
                    406: 
                    407: /*
                    408:        *INITIALIZATION CODE
                    409:        *
                    410:        * MME off; mode = k; IPL = 31; IS = 1
                    411:        *
                    412: */
                    413: 
                    414:        .globl  start
                    415: start:
                    416:        mtpr    $0,$MME         /* Disable MME */
                    417: 
                    418:        movl    r0,_tno         /* R0 : Test no to run; 0 run all tests */
                    419:        movl    r1,_option
                    420:        movl    r2,_Cycle       /* R2 : Cycle count */
                    421: 
                    422:        clrl    _cycle
                    423:        clrl    _lptest
                    424:        movl    $1,_Emsg                /* Turn on messages sense switch */
                    425:        andl3   _option,$0x8,_ss1       /* Heading message sense switch */
                    426: 
                    427:        tstl    _tno            /* Set lptest if tno = XX and loop forever */
                    428:        beql    1f
                    429:        cmpl    _Cycle,$-1
                    430:        bneq    extest
                    431:        incl    _lptest
                    432: extest:
                    433:        movab   1f,r0
                    434:        andl2   $0xfffffff,r0
                    435:        jmp     (r0)                    /* Switch map S->U */
                    436: 1:
                    437:        mtpr    $0,$MME
                    438:        movab   _scb,r0
                    439:        andl2   $0x3ffffc00,r0
                    440:        mtpr    r0,$SCBB        /* Set SCBB  */
                    441:        mtpr    $0x1f,$IPL      /* Set IPL to HIGH */
                    442: 
                    443:        movpsl  r1
                    444:        andl2   $0xffffff00,r1          /* Mask out flags               */
                    445:        cmpl    r1,$0x041f0000          /*IS on,modes =k & IPL = 31?    */
                    446:        beql    1f
                    447: 2:     movl    $1,r0
                    448:        movl    $0x041f0000,r2
                    449:        halt                    /* PSL not initialized as expected      */
                    450: /*
                    451: #      Mask out bit 30,31 of SCB vectors
                    452: #      Will turm them back on when ready to go virtual in 
                    453: #      system space
                    454: */
                    455: 1:
                    456:        clrl    _clk_cnt
                    457:        movl    $7,r0           /* R0 : Vector no. of clock int. */
                    458:        movab   _Hardclk,_scb[r0]       /* New vector for clock */
                    459:        movl    $NBPG/4,r1              /* One page for SCB */
                    460:        movab   _scb,r0
                    461:        andl2   $0x3ffffc00,r0
                    462: 1:     andl2   $0x3fffffff,(r0)
                    463:        addl2   $4,r0
                    464:        decl    r1                      /* Last one yet ? */
                    465:        bneq    1b
                    466: 
                    467: 
1.1.1.2 ! root      468:        movl    $_intstack+NISP,r0
1.1       root      469:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
                    470:        mtpr    r0,$ISP                 /* init. ISP            */
                    471:        movl    r0,sp                   /* in case we get exception     */
                    472:        movab   (sp),fp                 /* Initialize FP                */
                    473: 
1.1.1.2 ! root      474:        movl    $_usrstack+NISP,r0
        !           475:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
        !           476:        mtpr    r0,$KSP                 /* init. KSP            */
        !           477: 
        !           478: 
1.1       root      479: /*
                    480:        Clear system data area all the way upto system code
                    481:        this includes dump buffer,interrupt stack,spt,iomap,pcbs,user 
                    482:        page tables, & io buffer area.
                    483: */
                    484: 3:     
                    485:        movab   esysdata,r7
                    486:        movab   _restart,r6
                    487: 1:     clrl    (r6)
                    488:        ACBL(r7,$4,r6,1b)
                    489: /*
                    490:        Initialize System Page Table
                    491: */
                    492: 5:
                    493:        clrl    r2
                    494:        movab   esysdata,r1     /* R1 = Last address in system data area */
                    495:        andl2   $0x3fffffff,r1  /* Mask out bit 30,31   */
                    496:        shar    $PGSHIFT,r1,r1  /* Get page no. of last system data addr  */
                    497:                                /* Map systm data area 1 to 1,kernel writable */
                    498: 1:
                    499:        movl    r2,r11          /* Donot want to use orl3 */
                    500:        orl2    $PG_V|PG_KW,r11
                    501:        orl2    r11,_Sysmap[r2]
                    502:        aoblss  r1,r2,1b
                    503: /*
                    504:        Map system text area 1 to 1, Kernel read/write.
                    505:        For this to work, the label _etext must exist at the end 
                    506:        of system code; Add in 4 more pages for data area used in C
                    507: */
                    508:        movab   _edata + 4*(NBPG-1),r1  /* Map text+data 1 to 1; Kernel R/W */
                    509: /*     movab   _etext + 4*(NBPG-1), r1         */
                    510:        andl2   $0x3fffffff,r1
                    511:        shar    $PGSHIFT,r1,r1
                    512: 1:
                    513:        movl    r2,r11
                    514:        orl2    $PG_V|PG_KW,r11         /* Kernel Read/Write */
                    515:        orl2    r11,_Sysmap[r2]
                    516:        aoblss  r1,r2,1b
                    517: /*
                    518:        Map from here (1st unused page) to page 512 :
                    519:           * invalid,no access, & virtual = physical
                    520: */
                    521:        movl    r2,_unused      /* Save first unused physical page no   */
                    522:        movl    $LSP+1,r1
                    523: 1:     movl    r2,_Sysmap[r2]
                    524:        aoblss  r1,r2,1b
                    525: 
                    526: /*
                    527:        Initialize SBR, SLR
                    528:  *Following are some useful addresses for user 0 (in case you want
                    529:  *to start user 0:
                    530:  *
                    531:  *     p0br = $_u0p0pt (limit = 256 max)
                    532:  *     p1br = $_u0p1pt ( same limit)
                    533:  *     p2br = $0xbfc02c00 (funny)
                    534:  *     p2lr = $0x000ffff0 (funny)
                    535:  *
                    536:  *for other users, add NBPG*3 to above except for p2 area
                    537:  *
                    538:  *     u0_user_sp = 0xbffffbfc
                    539:  *     u0_k_sp    = 0xbfffe3fc
                    540:  *     u0_s_sp    = 0xbfffcbfc
                    541:  *     u0_e_sp    = 0xbfffcbfc
                    542:  *
                    543: */
                    544: 
                    545: sysrdy:
                    546:        mtpr    $(_Sysmap-0xc0000000),$SBR      /* Set SYSTEM BASE REG */
                    547:        mtpr    $_Syssize,$SLR
                    548: 
                    549:        .globl  _ready
                    550: _ready:
                    551:        mtpr    $64,$DCR        /* Enable fault */                              
                    552:        movab   tfail,badrtn
                    553: 
                    554:        tstl    _ss1
                    555:        jeql    1f
                    556:        pushab  M0
                    557:        callf   $8,_writes      /* Print heading */
                    558: 
                    559:        cmpl    $0,_tno
                    560:        beql    t0
                    561:        cmpl    $1,_tno
                    562:        bneq    nxt1
                    563: t0:
                    564:        tstl    _ss1
                    565:        jeql    1f
                    566:        pushab  M1
                    567:        callf   $8,_writes
                    568: 1:
                    569:        clrl    _Errmsg
                    570:        callf   $4,_prvreg      /* Subtest1 : MTPR/MFPR from privilege regs */
                    571:        tstl    _lptest
                    572:        bneq    t0
                    573: nxt1:
1.1.1.2 ! root      574:        movab   (sp),r0
        !           575:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
        !           576:        mtpr    r0,$ISP                 /* init. ISP */
        !           577: 
        !           578:        movl    $_usrstack+NISP,r0
        !           579:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
        !           580:        mtpr    r0,$USP                 /* init. USP            */
        !           581: 
        !           582:        movl    $_kerstack+NISP,r0
        !           583:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
        !           584:        mtpr    r0,$KSP                 /* init. KSP            */
        !           585: 
1.1       root      586:        cmpl    $0,_tno
                    587:        beql    t1
                    588:        cmpl    $2,_tno
                    589:        bneq    nxt2
                    590: t1:
                    591:        tstl    _ss1
                    592:        jeql    1f
                    593:        pushab  M2
                    594:        callf   $8,_writes
                    595: 1:
                    596:        clrl    _Errmsg
                    597:        callf   $4,_prvinstr    /* Subtest2 : Test ldpctx, svpctx, rei */
                    598:        tstl    _lptest
                    599:        bneq    t1
                    600: nxt2:
                    601:        cmpl    $0,_tno
                    602:        beql    t2
                    603:        cmpl    $3,_tno
                    604:        bneq    nxt3
                    605: t2:
                    606:        tstl    _ss1
                    607:        jeql    1f
                    608:        pushab  M3
                    609:        callf   $8,_writes
                    610: 1:
                    611:        clrl    _Errmsg
                    612:        callf   $4,_be_evt      /* Subtest3 : Bus error interrupt       */
                    613:        tstl    _lptest         /* again on this test */
                    614:        bneq    t2
                    615: nxt3:
                    616:        cmpl    $0,_tno
                    617:        beql    t3
                    618:        cmpl    $4,_tno
                    619:        bneq    nxt4
                    620: t3:
                    621:        tstl    _ss1
                    622:        jeql    1f
                    623:        pushab  M4
                    624:        callf   $8,_writes
                    625: 1:
                    626:        clrl    _Errmsg
                    627:        callf   $4,_roprnd_evt  /* Subtest4  : Reserved operand fault   */
                    628:        tstl    _lptest
                    629:        bneq    t3
                    630: nxt4:
                    631:        cmpl    $0,_tno
                    632:        beql    t4
                    633:        cmpl    $5,_tno
                    634:        bneq    nxt5
                    635: t4:
                    636:        tstl    _ss1
                    637:        jeql    1f
                    638:        pushab  M5
                    639:        callf   $8,_writes
                    640: 1:     clrl    _Errmsg
                    641:        callf   $4,_prv_evt     /* Subtest5  : Privilege inst. fault    */
                    642:        tstl    _lptest
                    643:        bneq    t4
                    644: nxt5:
                    645:        cmpl    $0,_tno
                    646:        beql    t5
                    647:        cmpl    $6,_tno
                    648:        bneq    nxt6
                    649: t5:
                    650:        tstl    _ss1
                    651:        jeql    1f
                    652:        pushab  M6
                    653:        callf   $8,_writes
                    654: 1:     clrl    _Errmsg
                    655:        callf   $4,_align_evt   /* Subtest6  : Data alignment fault     */
                    656:        tstl    _lptest
                    657:        bneq    t5
                    658: nxt6:
                    659:        cmpl    $0,_tno
                    660:        beql    t6
                    661:        cmpl    $7,_tno
                    662:        bneq    nxt7
                    663: t6:
                    664:        tstl    _ss1
                    665:        jeql    1f
                    666:        pushab  M7
                    667:        callf   $8,_writes
                    668: 1:     clrl    _Errmsg
                    669:        callf   $4,_raddr_evt   /* Subtest7  : Reserved addr. mode fault */
                    670:        tstl    _lptest
                    671:        bneq    t6
                    672: nxt7:
                    673:        cmpl    $0,_tno
                    674:        beql    t7
                    675:        cmpl    $8,_tno
                    676:        bneq    nxt8
                    677: t7:
                    678:        tstl    _ss1
                    679:        jeql    1f
                    680:        pushab  M8
                    681:        callf   $8,_writes
                    682: 1:     clrl    _Errmsg
                    683:        callf   $4,_rsv_evt      /* Subtest8  : Reserved instuction fault */
                    684:        tstl    _lptest
                    685:        bneq    t7
                    686: nxt8:
                    687: # 6/14/85 brw  nxt9    /* SKIP THIS TEST because of backplane problem  */
                    688:        mtpr    $0x400,$DCR     /* Is there a floating point out there? */
                    689:        tstl    r1              /*   -R1 will be non zero if there is.  */
                    690:        bneq    1f              /* test the arithmetic fault w/ FPP's   */
                    691:        bitl    $0x10,_option   /* test the arithmetic fault anyway?    */
                    692:        beql    nxt9            /* -don't run it (backplane problem )*/
                    693: 1:
                    694:        cmpl    $0,_tno
                    695:        beql    t8
                    696:        cmpl    $9,_tno
                    697:        bneq    nxt9
                    698: t8:
                    699:        tstl    _ss1
                    700:        jeql    1f
                    701:        pushab  M9
                    702:        callf   $8,_writes
                    703: 1:     clrl    _Errmsg
                    704:        callf   $4,_arith_evt    /* Subtest9  : Arithmetic fault        */
                    705:        tstl    _lptest
                    706:        bneq    t8
                    707: nxt9:
                    708:        cmpl    $0,_tno
                    709:        beql    t9
                    710:        cmpl    $10,_tno
                    711:        bneq    nxt10
                    712: t9:
                    713:        tstl    _ss1
                    714:        jeql    1f
                    715:        pushab  M10
                    716:        callf   $8,_writes
                    717: 1:     clrl    _Errmsg
                    718:        callf   $4,_bpt_evt     /* subtest10  : Break point instruction test */
                    719:        tstl    _lptest
                    720:        bneq    t9
                    721: nxt10:
                    722:        cmpl    $0,_tno
                    723:        beql    t10
                    724:        cmpl    $11,_tno
                    725:        bneq    nxt11
                    726: t10:
                    727:        tstl    _ss1
                    728:        jeql    1f
                    729:        pushab  M11
                    730:        callf   $8,_writes
                    731: 1:     clrl    _Errmsg
                    732:        callf   $0,_ttrap_evt   /* Subtest11 : Trace trap test */
                    733:        tstl    _lptest
                    734:        bneq    t10
                    735: nxt11:
                    736:        cmpl    $0,_tno
                    737:        beql    t11
                    738:        cmpl    $12,_tno
                    739:        jneq    nxt12
                    740: t11:
                    741:        tstl    _ss1
                    742:        jeql    1f
                    743:        pushab  M12
                    744:        callf   $8,_writes
                    745: 1:     clrl    _Errmsg
                    746:        callf   $4,_sftint_evt  /* Subtest12 : Software interrupt test */
                    747:        tstl    _lptest
                    748:        bneq    t11
                    749: 
                    750: /*             GO TO VIRTUAL MODE
                    751:        Double map the kernel into user addresses : 
                    752:        This will enable system to go to virtual mode the 1st time !!
                    753: */
                    754: nxt12:
                    755:        mtpr    $(_Sysmap-0xc0000000),$SBR      /* Set SYSTEM BASE REG */
                    756:        mtpr    $_Syssize,$SLR
                    757:        mtpr    $_Sysmap,$P0BR
                    758:        mtpr    $_Syssize,$P0LR
                    759:        mtpr    $1,$PADC
                    760:        mtpr    $1,$TBIA
                    761:        mtpr    $1,$MME
                    762:        jmp     *$vmode
                    763: vmode:
                    764:        mtpr    $0,$P0LR
                    765: 
1.1.1.2 ! root      766:        movl    $_intstack+NISP,r0
1.1       root      767:        mtpr    r0,$ISP                 /* init. ISP,sp to virtual address */
                    768:        movl    r0,sp
                    769: 
                    770: /*
                    771:        Set bit 30,31 of SCB vectors on.
                    772:        Now we are running virtual in system space
                    773: */
                    774:        movl    $NBPG/4,r1              /* One page for SCB */
                    775:        movab   _scb,r0
                    776:        andl2   $0xfffffc00,r0
                    777: 1:     orl2    $0xc0000000,(r0)
                    778:        addl2   $4,r0
                    779:        decl    r1                      /* Last one yet ? */
                    780:        bneq    1b
                    781: 
                    782:        movab   tfail,badrtn
                    783: 
                    784:        cmpl    $0,_tno
                    785:        beql    t12
                    786:        cmpl    $13,_tno
                    787:        bneq    nxt13
                    788: t12:
                    789:        tstl    _ss1
                    790:        jeql    1f
                    791:        pushab  M13
                    792:        callf   $8,_writes
                    793: 1:     clrl    _Errmsg
                    794:        calls   $4,_kcall_evt           /* KCALL test */
                    795:        tstl    _lptest
                    796:        bneq    t12
                    797: nxt13:
                    798:        cmpl    $0,_tno
                    799:        beql    t13
                    800:        cmpl    $14,_tno
                    801:        bneq    nxt14
                    802: t13:
                    803:        tstl    _ss1
                    804:        jeql    1f
                    805:        pushab  M14
                    806:        callf   $8,_writes
                    807: 1:     clrl    _Errmsg
                    808:        calls   $4,_trans_evt           /* Translation fault */
                    809:        tstl    _lptest
                    810:        bneq    t13
                    811: nxt14:
                    812:        cmpl    $0,_tno
                    813:        beql    t14
                    814:        cmpl    $15,_tno
                    815:        bneq    nxt15
                    816: t14:
                    817:        tstl    _ss1
                    818:        jeql    1f
                    819:        pushab  M15
                    820:        callf   $8,_writes
                    821: 1:     clrl    _Errmsg
                    822:        calls   $4,_probe_evt           /* PROBER/PROBEW test */
                    823:        tstl    _lptest
                    824:        bneq    t14
                    825: nxt15:
                    826:        cmpl    $0,_tno
                    827:        beql    t15
                    828:        cmpl    $16,_tno
                    829:        bneq    nxt16
                    830: t15:
                    831:        tstl    _ss1
                    832:        jeql    1f
                    833:        pushab  M16
                    834:        callf   $8,_writes
                    835: 1:     clrl    _Errmsg
                    836:        calls   $4,_ksnv_evt            /* Kernel stack not valid test */
                    837:        tstl    _lptest
                    838:        bneq    t15
                    839: nxt16:
                    840:        cmpl    $0,_tno
                    841:        beql    t16
                    842:        cmpl    $17,_tno
                    843:        bneq    nxt17
                    844: t16:
                    845:        tstl    _ss1
                    846:        jeql    1f
                    847:        pushab  M17
                    848:        callf   $8,_writes
                    849: 1:     clrl    _Errmsg
                    850:        calls   $4,_mulevt              /* Multiple events test */
                    851:        tstl    _lptest
                    852:        bneq    t16
                    853: nxt17:
1.1.1.2 ! root      854:        incl    _cycle
1.1       root      855:        cmpl    $0,_tno
                    856:        jneq    last
                    857:        cmpl    $-1,_Cycle              /* If Cycle == -1; loop forever */
                    858:        beql    1f                      /* and skip the last test */
                    859:        subl3   _cycle,_Cycle,r0
1.1.1.2 ! root      860:        cmpl    $0,r0                   /* Only (ALL tests and last cycle) */
1.1       root      861:        jlss    last                    /* turn on this test */
                    862: t17:
                    863:        pushl   $M18                    /* Display msg */
                    864:        callf   $8,_writes
                    865:        pushl   $M19
                    866:        callf   $8,_writes
                    867:        pushl   $M20
                    868:        callf   $8,_writes
                    869:        clrl    _Errmsg
                    870:        calls   $4,_isnv_evt            /* Interrupt stack not valid test */
                    871:                                        /* NO RETURN FROM THIS TEST */
                    872: last:
                    873:        cmpl    $-1,_Cycle              /* If Cycle == -1; loop forever */
                    874:        beql    1f
                    875: 
                    876:        cmpl    _cycle,_Cycle
                    877:        bgeq    passed
1.1.1.2 ! root      878: 
        !           879: 1:     mfpr    $SBR,r0
1.1       root      880:        mfpr    $SLR,r1
                    881:        orl2    $0xc0000000,r0
                    882:        mtpr    r0,$P0BR
                    883:        mtpr    r1,$P0LR                /* Map user to system space */
                    884:        jmp     extest
                    885: 
                    886: passed:
                    887:        tstl    _ss1
                    888:        jeql    1f
                    889:        pushab  M21             /* Cycle count */
                    890:        callf   $4+4,_writes
                    891:        pushl   _Cycle
                    892:        callf   $4+4,_writeh
                    893:        pushab  M22
                    894:        callf   $4+4,_writes
                    895: 1:
                    896:        movl    $0xcafebabe,r0
                    897:        halt
                    898:        .space  20
                    899: 
                    900:        .globl  tfail
                    901: tfail:                                 /* enter here when test fail */
                    902:        storer  $0x1fff,Gregs           /* save registers */
                    903:        tstl    _Emsg                   /* If set then donot print message */
                    904:        beql    nomsg
                    905:        movl    _Errmsg,r0
                    906:        beql    1f
                    907:        pushl   r0                      /* Print errror message if any */
                    908:        callf   $8,_writes
                    909: 1:
                    910:        pushab  Gregs
                    911:        callf   $8,_error               /* Dump general registers */
                    912: nomsg:
                    913:        loadr   $0x1fff,Gregs           /* load registers */
                    914:        halt
                    915: 
                    916: 
                    917:        .align  2
                    918:        .globl  _Hardclk
                    919: _Hardclk:
                    920:        incl    _clk_cnt
                    921:        rei
                    922: 
                    923: 
                    924:        .data   1
                    925: M0:
                    926:        .ascii  "\n\t** The Event Test **\12\0"
                    927: M1:
                    928:        .ascii  "** Subtest1  : MTPR/MFPR from privilege registers \12\0"
                    929: M2:
                    930:        .ascii  "** Subtest2  : Test LDPCTX, SVPCTX, REI \12\0"
                    931: M3:
                    932:        .ascii  "** Subtest3  : Bus error interrupt     \12\0"
                    933: M4:
                    934:        .ascii  "** Subtest4  : Reserved operand fault\12\0"
                    935: M5:
                    936:        .ascii  "** Subtest5  : Privilege inst. fault \12\0"
                    937: M6:
                    938:        .ascii  "** Subtest6  : Data alignment fault    \12\0"
                    939: M7:
                    940:        .ascii  "** Subtest7  : Reserved addr. mode fault \12\0"
                    941: M8:
                    942:        .ascii  "** Subtest8  : Reserved instruction fault \12\0"
                    943: M9:
                    944:        .ascii  "** Subtest9  : Arithmetic fault\12\0"
                    945: M10:
                    946:        .ascii  "** Subtest10 : Break point instruction test \12\0"
                    947: M11:
                    948:        .ascii  "** Subtest11 : Trace trap test \12\0"
                    949: M12:
                    950:        .ascii  "** Subtest12 : Software interrupt test \12\0"
                    951: M13:
                    952:        .ascii  "** Subtest13 : KCALL\12\0"
                    953: M14:
                    954:        .ascii  "** Subtest14 : Translation fault\12\0"
                    955: M15:
                    956:        .ascii  "** Subtest15 : PROBER/PROBEW\12\0"
                    957: M16:
                    958:        .ascii  "** Subtest16 : Kernel stack not valid test\12\0"
                    959: M17:
                    960:        .ascii  "** Subtest17 : Mutiple events test\12\0"
                    961: M18:
                    962:        .ascii  "** Subtest18 : Interrupt stack not valid test.\12\0"
                    963: M19:
                    964:        .ascii  "If TAHOE get a machine check after you see this message\12\0"
                    965: M20:
                    966:        .ascii  " then The EVENT test passed !\12\0"
                    967:        
                    968: M21:   .ascii  "\n** Cycle count : \0"
                    969: M22:   .ascii  "\n\0"
                    970: 
                    971:        .globl  err1
                    972: err1:
                    973:        .ascii  "\nRegisters : \0"
                    974:        .globl  err2
                    975: err2:
                    976:        .ascii  "  \0"
                    977:        .globl  err3
                    978: err3:
                    979:        .ascii  "\n            \0"
                    980:        .globl  err4
                    981: err4:
                    982:        .ascii  "\n\0"
                    983: 
                    984:        .globl  e_type
                    985: e_type:
                    986:        .ascii  "\n** Unexpected exception type : \0"
                    987: 
                    988:        .globl  par_0
                    989: par_0:
                    990:        .ascii  "** Par 0 : \0"
                    991: 
                    992:        .globl  par_1
                    993: par_1:
                    994:        .ascii  "** Par 1 : \0"
                    995: 
                    996:        .globl  par_pc
                    997: par_pc:
                    998:        .ascii  "** PC    : \0"
                    999: 
                   1000:        .globl  par_psl
                   1001: par_psl:
                   1002:        .ascii  "** PSL   : \0"
                   1003: 
                   1004:        .align  2
                   1005: Gregs: .space  60      /* Space to save general registers */
                   1006:        .align  2
                   1007:        .globl  _Errmsg
                   1008: _Errmsg:
                   1009:        .long   0       /* Pointer to error message */
                   1010:        .globl  _ss1
                   1011: _ss1:  .long   0       /* If 1 then donot print heading messages */
                   1012:        .globl  _tno
                   1013: _tno:  .long   0       /* If -1 run ALL tests, else run test "tno" */
                   1014:        .globl  _Cycle
                   1015: _Cycle:        .long   0       /* Cycle count */
                   1016:        .globl  _cycle
                   1017: _cycle:        .long   0       /* Cycle count */
                   1018:        .globl  _option
                   1019: _option:
                   1020:        .long   0
                   1021:        .globl  _lptest
                   1022: _lptest:
                   1023:        .long   0       /* Loop on test specified by tno */
                   1024:        .globl  _CPer
                   1025: _CPer:
                   1026:        .long   0
                   1027:        .globl  _Emsg
                   1028: _Emsg:
                   1029:        .long   1
                   1030: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.