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

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

unix.superglobalmegacorp.com

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