Annotation of cci/d/pits/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: 
                     18: #include       "conf.h"
                     19: /*     privileged registers addresses  */
                     20: #include       "prvreg.h"
                     21:        
                     22: /*     program status long word definition     */
                     23: #include       "psl.h" 
                     24: 
                     25: /*     page table entry definition             */
                     26: #include       "pte.h"
                     27:        
                     28: /*     process control block offsets   */
                     29: #include       "pcboffset.h"   
                     30: 
                     31: /*     fundamental constants for globl use     */
                     32: #include       "const.h"       
                     33: 
                     34: /*     system control block offsets*/
                     35: #include       "scboffset.h"
                     36: /*     SPT offsets                             */
                     37: #include       "sptoffset.h"
                     38: 
                     39: /*     trap numbers*/
                     40: #include       "trap.h"        
                     41: 
                     42: 
                     43: #define V_TRAP         0
                     44: #define V_SYSCALL      4
                     45: 
                     46:        .set    HIGH,0x1f       /*mask for disabling all interrupts     */
                     47:        .set    MCKVEC,4        /*scb offset for machinecheck vector    */
                     48:        .set    NISP,2          /*no. of interrupt stack pages          */
                     49:        .set    DONE,255        /*user process done code                */
                     50: 
                     51:        .text
                     52: 
                     53: #include "pstorage.s"          /* PROCESSOR STORAGE AREA               */
                     54: 
                     55:        .globl  _Entry
                     56: _Entry:
                     57:        mtpr    $0x1f,$IPL
                     58:        jmp     start
                     59:        .space  (1024-9)
                     60: 
                     61: 
                     62: 
                     63: /*             globl dump buffer to be used for communication          */
                     64: /*             between tests & interrupt handlers, & other misc.       */
                     65: /*             purposes.                                               */
                     66:                                
                     67:                                /*physical page 3                       */
                     68: 
                     69:        .set    NLWU,32         /*no. of longwords already used         */
                     70:                                /*this must be changed when you define  */
                     71:                                /*additional variables below before     */
                     72:                                /*_dbuf                                 */
                     73:        .globl  _restart
                     74: _restart:
                     75:        .space  4               /*contains restart address for restarting*/
                     76:                                /*after power is restored (loaded by    */
                     77:                                /*power fail interrupt handler & used by*/
                     78:                                /*CPU 2                                 */      
                     79: /*     ******************      */
                     80:        .globl  _cyconf         /*  address : 0xc04                     */
                     81: _cyconf:                       /*  Cypher configuration pointer : 0xc06  */
                     82:        .space  4
                     83:        .space  4
                     84: /*     ******************      */
                     85: 
                     86:        .globl  _Unused
                     87: _Unused:
                     88:        .space  4               /* Just a copy of variable 'unused'     */
                     89: 
                     90:        .globl  _unused
                     91: _unused:
                     92:        .space  4               /*first unused page in system space     */
                     93: 
                     94:        .globl  _ctlblk
                     95: _ctlblk:
                     96:        .long   0               /* pointer to SCB */
                     97: 
                     98:        .globl  _savvec0        /*save vectors area                     */
                     99: _savvec0:
                    100:        .space  4
                    101: 
                    102:        .globl  _savvec1        /*save vectors area                     */
                    103: _savvec1:
                    104:        .space  4
                    105: 
                    106:        .globl  _savvec2        /*save vectors area                     */
                    107: _savvec2:
                    108:        .space  4
                    109: 
                    110:        .globl  _savvec3        /*save vectors area                     */
                    111: _savvec3:
                    112:        .space  4
                    113: 
                    114:        .globl  _savvec4        /*save vectors area                     */
                    115: _savvec4:
                    116:        .space  4
                    117: 
                    118:        .globl  _savvec5        /*save vectors area                     */
                    119: _savvec5:
                    120:        .space  4
                    121:        .globl  _savvec6        /*save vectors area                     */
                    122: _savvec6:
                    123:        .space  4
                    124:        .globl  _savvec7        /*save vectors area                     */
                    125: _savvec7:
                    126:        .space  4
                    127: 
                    128:        .globl  _savvec8        /*save vectors area                     */
                    129: _savvec8:
                    130:        .space  4
                    131: 
                    132: testno: .long  0
                    133: 
                    134:        .globl  _dbuf           /*dump buffer left out of 1K            */
                    135:        .globl  _r_no
                    136: _r_no:
                    137:        .long   0
                    138:        .globl  _pt_base
                    139: _pt_base:
                    140:        .long   0
                    141:        .globl  _saved_psl
                    142: _saved_psl:
                    143:        .long   0
                    144:        .globl  _saved_sp
                    145: _saved_sp:
                    146:        .long   0
                    147:        .globl  _saved_fp
                    148: _saved_fp:
                    149:        .long   0
                    150:        .globl  _p_ptr
                    151: _p_ptr:
                    152:        .long   0
                    153:        .globl  _ret_adr
                    154: _ret_adr:
                    155:        .long   0
                    156:        .globl  _exp_par0
                    157: _exp_par0:
                    158:        .long   0
                    159:        .globl  _exp_par1
                    160: _exp_par1:
                    161:        .long   0
                    162:        .globl  _exp_par2
                    163: _exp_par2:
                    164:        .long   0
                    165:        .globl  _exp_par3
                    166: _exp_par3:
                    167:        .long   0
                    168:        .globl  _act_par0
                    169: _act_par0:
                    170:        .long   0
                    171:        .globl  _act_par1
                    172: _act_par1:
                    173:        .long   0
                    174: 
                    175:        .globl  _IOpage
                    176: _IOpage:
                    177:        .long   0               /* Pointer 64K I/O pages */
                    178: #
                    179: #
                    180: #
                    181:        .globl  _proc_no
                    182: _proc_no:
                    183:        .long   0
                    184: 
                    185:        .globl  _clk_cnt
                    186: _clk_cnt:
                    187:        .long   0
                    188: _dbuf:
                    189:        .space  NBPG - (NLWU *4)
                    190: edbuf:
                    191: 
                    192: 
                    193:        .globl  _intstack       /* Interrupt stack                      */
                    194: _intstack:                     /* Physical pages 4 & 5                 */
                    195:        .space  NISP*NBPG
                    196: eintstack:
                    197: 
                    198: 
                    199:        .set    SYSPTSIZE,512   /* No. of entries in SPT                */
                    200:  
                    201: /*
                    202:        System Page Table -- physical page 6 & 7
                    203: */ 
                    204:        .align  2
                    205:        .globl  _Sysmap
                    206: _Sysmap:
                    207:        .space  SYSPTSIZE*4     /* 512 max pages allowed for system     */
                    208: eSysmap:
                    209:        .globl  _Syssize
                    210:        .set    _Syssize,(eSysmap-_Sysmap)/4    /* should be SYSPTSIZE  */
                    211:        
                    212:        .globl  _iomap          /* Physical page 8      */
                    213: _iomap:        .space  1024            /* IOMAP - unused       */
                    214:        .globl  _eiomap
                    215: _eiomap:
                    216: 
                    217:        .globl  _pcb0           /* Physical page 9      */
                    218: _pcb0: .space  128             /*process control block 0               */
                    219:        .globl  _pcb1
                    220: _pcb1: .space 128              /*process control block 1               */
                    221:        .globl  _pcb2
                    222: _pcb2: .space 128              /*process control block 2               */
                    223:        .globl  _pcb3
                    224: _pcb3: .space 128              /*process control block 3               */
                    225:        .globl  _pcb4
                    226: _pcb4: .space 128              /*process control block 4               */
                    227:        .globl  _pcb5
                    228: _pcb5: .space 128              /*process control block 5               */
                    229:        .globl  _pcb6
                    230: _pcb6: .space 128              /*process control block 6               */
                    231:        .globl  _pcb7
                    232: _pcb7: .space 128              /*process control block 7               */
                    233: 
                    234: /*
                    235:        *user #0 page tables -- P0PT, P1PT, P2PT                        
                    236:        *physical memory     --  page10, 11, & 12  respectively
                    237: */
                    238:        .align  2
                    239:        .globl  _u0p0pt
                    240: _u0p0pt:
                    241:        .space  1024            /*255 max pages for user #0 text        */
                    242:        .globl  _u0p1pt
                    243: _u0p1pt:       
                    244:        .space  1024            /*255 max pages for user #0 data        */
                    245:        .globl  _u0p2pt
                    246: _u0p2pt:       
                    247:        .space  1020            /*255 max pages for user #0 stack       */
                    248: eu0p2pt:
                    249:        .space  4
                    250: 
                    251: /*
                    252:        *user #1 page tables -- P0PT, P1PT, P2PT                        
                    253:        *physical memory     --  page13 ,14, & 15  respectively
                    254: */
                    255:        .align  2
                    256:        .globl  _u1p0pt
                    257: _u1p0pt:
                    258:        .space  1024            /*255 max pages for user #1 text        */
                    259:        .globl  _u1p1pt
                    260: _u1p1pt:       
                    261:        .space  1024            /*255 max pages for user #1 data        */
                    262:        .globl  _u1p2pt
                    263: _u1p2pt:       
                    264:        .space  1020            /*255 max pages for user #1 stack       */
                    265: eu1p2pt:
                    266:        .space  4
                    267: 
                    268: 
                    269: /*
                    270:        *user #2 page tables -- P0PT, P1PT, P2PT                        
                    271:        *physical memory     --  page 16, 17 , & 18  respectively
                    272: */
                    273:        .align  2
                    274:        .globl  _u2p0pt
                    275: _u2p0pt:
                    276:        .space  1024            /*255 max pages for user #2 text        */
                    277:        .globl  _u2p1pt
                    278: _u2p1pt:       
                    279:        .space  1024            /*255 max pages for user #2 data        */
                    280:        .globl  _u2p2pt
                    281: _u2p2pt:       
                    282:        .space  1020            /*255 max pages for user #2 stack       */
                    283: eu2p2pt:
                    284:        .space  4
                    285: 
                    286: 
                    287: /*
                    288:        *user #3 page tables -- P0PT, P1PT, P2PT                        
                    289:        *physical memory     --  page 19, 20 , & 21  respectively
                    290: */
                    291:        .align  2
                    292:        .globl  _u3p0pt
                    293: _u3p0pt:
                    294:        .space  1024            /*255 max pages for user #3 text        */
                    295:        .globl  _u3p1pt
                    296: _u3p1pt:       
                    297:        .space  1024            /*255 max pages for user #3 data        */
                    298:        .globl  _u3p2pt
                    299: _u3p2pt:       
                    300:        .space  1020            /*255 max pages for user #3 stack       */
                    301: eu3p2pt:
                    302:        .space  4
                    303: 
                    304: /*
                    305:        *user #4 thru 6 page tables
                    306:        *physical memory -- pages 22 thru 30
                    307: */
                    308:        .globl  _u4p0pt
                    309: _u4p0pt:
                    310:        .space  (9*NBPG) - 4
                    311: eu6p2pt:
                    312:        .space  4
                    313: 
                    314: /*
                    315:        *user #7 page tables -- P0PT, P1PT, P2PT                        
                    316:        *physical memory     --  page 31, 32 , & 33  respectively
                    317: */
                    318:        .align  2
                    319:        .globl  _u7p0pt
                    320: _u7p0pt:
                    321:        .space  1024            /*255 max pages for user #7 text        */
                    322:        .globl  _u7p1pt
                    323: _u7p1pt:       
                    324:        .space  1024            /*255 max pages for user #7 data        */
                    325:        .globl  _u7p2pt
                    326: _u7p2pt:       
                    327:        .space  1020            /*255 max pages for user #7 stack       */
                    328: eu7p2pt:
                    329:        .space  4
                    330: 
                    331:        .globl  _Ksp0           /* Page used for Kernel stack of user0 */
                    332: _Ksp0: .space  1020
                    333: _Eksp0:        .long   0
                    334: 
                    335:        .globl  _Ksp1           /* Page used for Kernel stack of user1 */
                    336: _Ksp1: .space  1020
                    337: _Eksp1:        .long   0
                    338: 
                    339:        .globl  _Ksp2           /* Page used for Kernel stack of user2 */
                    340: _Ksp2: .space  1020
                    341: _Eksp2:        .long   0
                    342: 
                    343:        .globl  _Ksp3           /* Page used for Kernel stack of user3 */
                    344: _Ksp3: .space  1020
                    345: _Eksp3:        .long   0
                    346: 
                    347:        .globl  _Ksp4           /* Page used for Kernel stack of user4 */
                    348: _Ksp4: .space  1020
                    349: _Eksp4:        .long   0
                    350: 
                    351:        .globl  _Ksp5           /* Page used for Kernel stack of user5 */
                    352: _Ksp5: .space  1020
                    353: _Eksp5:        .long   0
                    354: 
                    355:        .globl  _Ksp6           /* Page used for Kernel stack of user6 */
                    356: _Ksp6: .space  1020
                    357: _Eksp6:        .long   0
                    358: #
                    359: #      I/O buffers
                    360: #
                    361:        .globl  _iob0
                    362: _iob0: .space  1024
                    363:        .globl  _iob1
                    364: _iob1: .space  1024
                    365:        .globl  _iob2
                    366: _iob2: .space  1024
                    367:        .globl  _iob3
                    368: _iob3: .space  1024
                    369:        .globl  _iob4
                    370: _iob4: .space  1024
                    371:        .globl  _iob5
                    372: _iob5: .space  16384
                    373: 
                    374: esysdata:
                    375: 
                    376: #include "scblock.s"           /* SYSTEM CONTROL BLOCK                 */
                    377: 
                    378: 
                    379: 
                    380: 
                    381: 
                    382: 
                    383: #include       "evthandlers.s" /*event handlers                        */
                    384: 
                    385: #define        ACBL(_n1,_n2,_n3,_n4) \
                    386: addl2  _n2,_n3;\
                    387: cmpl   _n3,_n1;\
                    388: bleq   _n4;
                    389: 
                    390: 
                    391: 
                    392: /*
                    393:        *INITIALIZATION CODE
                    394:        *
                    395:        * MME off; mode = k; IPL = 31; IS = 1
                    396:        *
                    397: */
                    398: 
                    399:        .globl  start
                    400: start:
                    401:        mtpr    $0x1f,$IPL      /* Set IPL to HIGH */
                    402:        mtpr    $0,$MME         /* Disable MME */
                    403:        movab   _scb,r0
                    404:        andl2   $0x3ffffc00,r0
                    405:        mtpr    r0,$SCBB        /* Set SCBB  */
                    406: 
                    407:        movpsl  r1
                    408:        andl2   $0x001f0000,r1          /* Mask out flags               */
                    409:        cmpl    r1,$0x001f0000          /* modes = K & IPL = 31?        */
                    410:        beql    1f
                    411: 2:     movl    $1,r0
                    412:        movl    $0x041f0000,r2
                    413:        halt                    /* PSL not initialized as expected      */
                    414: 1:
                    415:        movl    $_intstack+NISP*NBPG,r0
                    416:        andl2   $0x3fffffff,r0          /* Mask out bit 30,31 */
                    417:        mtpr    r0,$ISP                 /* init. ISP            */
                    418:        movl    r0,sp                   /* in case we get exception     */
                    419:        movab   (sp),fp                 /* Initialize FP                */
                    420: #
                    421: #      Clear system data area all the way upto system code
                    422: #      this includes dump buffer,interrupt stack,spt,iomap,pcbs,user 
                    423: #      page tables, & io buffer area.
                    424: #
                    425: 3:     
                    426:        movab   esysdata,r7
                    427:        movab   _restart,r6
                    428: 1:     clrl    (r6)
                    429:        ACBL(r7,$4,r6,1b)
                    430: #
                    431: #      Initialize System Page Table
                    432: #
                    433: 5:
                    434:        clrl    r2
                    435:        movab   _Ksp6,r1        /* R1 = Last address in Kernel stack area */
                    436:        andl2   $0x3fffffff,r1  /* Mask out bit 30,31   */
                    437:        shar    $PGSHIFT,r1,r1  /* Get page no. of last page of Kstacks  */
                    438: 1:
                    439:        movl    r2,r11                  /* Donot want to use orl3 */
                    440:        orl2    $PG_V|PG_KW,r11
                    441:        orl2    r11,_Sysmap[r2]
                    442:        aobleq  r1,r2,1b
                    443: 
                    444:        movab   esysdata,r1     /* R1 = Last address in system data area */
                    445:        andl2   $0x3fffffff,r1  /* Mask out bit 30,31   */
                    446:        shar    $PGSHIFT,r1,r1  /* Get page no. of last system data addr  */
                    447: 1:
                    448:        movl    r2,r11                  /* Donot want to use orl3 */
                    449:        orl2    $PG_V|PG_KW|PG_NC,r11   /* Set I/O buffers non cachable */
                    450:        orl2    r11,_Sysmap[r2]
                    451:        aoblss  r1,r2,1b
                    452: #
                    453: #      Map system text area 1 to 1, Kernel read/write.
                    454: #      For this to work, the label _etext must exist at the end 
                    455: #      of system code; Add in 4 more pages for data area used in C
                    456: #
                    457:        movab   _end + (NBPG-1),r1      /* Map text+data 1 to 1; Kernel R/W */
                    458:        andl3   $0x3ffffc00,r1,_IOpage
                    459:        addl2   $64*(1024),r1
                    460:        andl2   $0x3fffffff,r1
                    461:        shar    $PGSHIFT,r1,r1
                    462: 1:
                    463:        movl    r2,r11
                    464:        orl2    $PG_V|PG_KW|PG_NC,r11   /* Kernel Read/Write, non_cachable */
                    465:        orl2    r11,_Sysmap[r2]
                    466:        aoblss  r1,r2,1b
                    467: #
                    468: #      Map from here (1st unused page) to page 512 :
                    469: #         * invalid,no access, & virtual = physical
                    470: #
                    471:        movl    r2,_unused      /* Save first unused physical page no   */
                    472:        movl    $LSP+1,r1
                    473: 1:     movl    r2,_Sysmap[r2]
                    474:        aoblss  r1,r2,1b
                    475: 
                    476: sysrdy:
                    477:        movab   _Sysmap,r0
                    478:        mtpr    r0,$SBR                 /* Set SYSTEM BASE REG */
                    479:        mtpr    $_Syssize,$SLR
                    480:        orl2    $0xc0000000,r0
                    481:        mtpr    r0,$P0BR                /* Set P0BR */
                    482:        mtpr    $_Syssize,$P0LR
                    483: 
                    484:        movl    $CLOCK,r0
                    485:        movab   _Xclock,_scb[r0]        /* Set clock handler */
                    486: 
                    487:        movl    $BUSER,r0
                    488:        movab   _Buser,_scb[r0]         /* Set bus error handler */
                    489: 
                    490:        clrl    _bturn
                    491:        clrl    _bell
                    492:        clrl    _btime
                    493:        mtpr    $1,$IPL                 /* Allow clock interrupt */
                    494:        incl    _IOinit                 /* Set flag so bus err don't print */   
                    495: #
                    496: #      Probe for VIOCs
                    497: #
                    498:        clrl    _viocs
                    499:        callf   $4,_chk_vadr
                    500:        movl    r0,_viocs
                    501: #
                    502: #      Probe for VDDCs
                    503: #
                    504:        clrl    _vddcs
                    505:        callf   $4,_chk_vdadr
                    506:        movl    r0,_vddcs
                    507:        .globl  _ready
                    508: _ready:
                    509:        clrl    _proc_no
                    510:        mtpr    $1,$PACC
                    511:        mtpr    $1,$PADC
                    512:        mtpr    $1,$TBIA
                    513:        mtpr    $1,$CCK                 /* Set Code Cache Key = 1 */
                    514:        mtpr    $1,$DCK                 /* Set Data Cache Key = 1 */
                    515:        mtpr    $1,$MME                 /* Enable MME */
                    516:        jmp     *$1f
                    517: 1:
                    518:        movab   _pcb0,r0
                    519:        movab   _Eksp0,(r0)             /* Set PCB0_KSP */
                    520:        mfpr    $P0BR,PCB_P0BR(r0)      /* Set PCB0_P0BR */
                    521:        mfpr    $P0LR,PCB_P0LR(r0)      /* Set PCB0_P0LR */
                    522:        mtpr    r0,$PCBB                /* Init PCBB to PCB_0 */
                    523:        ldpctx                          /* Just to switch to Kernel stack */
                    524:        mtpr    $1,$IPL                 /* Drop IPL to 1 */
                    525:        movl    (sp)+,r12               /* Pop unnecessary PC,PSL */
                    526:        movl    (sp)+,r11
                    527: #
                    528: #      The following tests are included : Tape, Vioc, Vddc.
                    529: #      Bit 0-2 of R0 correspond to Tape, Vioc, Vddc test. To disable
                    530: #      a particular test just set the corresponding bit to 1 before
                    531: #      start. For example, if only VIOC test to be run, set R0=5.
                    532: #      To run all, set R0 = 0. This process is now done by the
                    533: #      routine 'echo'.
                    534: #
                    535: #      Now that MME, probe for magtape
                    536: #
                    537: 1:     clrl    _tapes
                    538:        callf   $4,_chk_tape
                    539:        movl    r0,_tapes
                    540:        mfpr    $SLR,_Sslr              /* Save original SLR */
                    541:        movl    _unused,_Unused         /* Save 1st unused page */
                    542: go:
                    543:        mtpr    _Sslr,$SLR              /* Reinit. SLR with original value  */
                    544:        movl    _Unused,_unused         /* always restore it !! */
                    545:        pushab  imsg                    /* Select users options */
                    546:        callf   $8,_writes              /* Print message */
                    547:        callf   $8,_echo                /* Get user response */
                    548:        movl    r0,tst_mask             /* Save user option */
                    549: #
                    550: #      Tape Master Test
                    551: #
                    552:        andl3   $0x1,tst_mask,r0        /* Is Tape test selected */
                    553:        jneq    1f                      /* Skip to next test if not */
                    554:        callf   $4,_tape                /* set up to test tape */
                    555:        cmpl    $0,r0                   /* See if there was a controller */
                    556:        jeql    2f
                    557:        callf   $4,_tm_ex               /* Test magtape */
                    558: 2:
                    559:        clrl    _tape_ON                /* next test */
                    560:        brw     1f
                    561: #
                    562: #      VIOCs Test
                    563: #
                    564: 1:
                    565:        andl3   $0x2,tst_mask,r0
                    566:        bneq    1f
                    567:        tstl    _viocs          /* Any VIOCs to test ? */
                    568:        beql    2f
                    569:        callf   $4,_init_vec    /* Set up interrupt handlers for VIOCs */
                    570:        callf   $4,_vioc        /* VIOC test */
                    571:        clrl    _vioc_ON        /* next test */
                    572:        brw     1f
                    573: 2:
                    574:        pushab  nmsg            /* print no VIOCs message */
                    575:        callf   $4,_writes
                    576: #
                    577: #      VDDC Controller Test
                    578: #
                    579: 1:
                    580:        andl3   $0x4,tst_mask,r0
                    581:        jneq    1f
                    582:        tstl    _vddcs          /* Any VDDCs to test ? */
                    583:        beql    1f
                    584:        callf   $4,_vddc        /* Set up to test VDDCs */
                    585:        cmpl    $0,r0           /* See if there were any controllers */
                    586:        jeql    2f
                    587:        callf   $4,_vddc_ex     /* Test VDDCs */
                    588: 2:
                    589:        clrl    _vddc_ON        /* Print Done msg */
                    590:        brw     1f
                    591: #
                    592: #
                    593: #
                    594: 1:
                    595:        clrl    _Berr                   /* Clear the bus error flag */
                    596:        clrl    _IOinit
                    597:        clrl    _Multi
                    598:        movl    tst_mask,r0
                    599:        jmp     go                      /* Restart the test   */
                    600: #
                    601: #      Real time clock Handler
                    602: #
                    603:        .align  2
                    604:        .globl  _Xclock
                    605: _Xclock:
                    606:        rei
                    607: 
                    608: #
                    609: #      Bus error handler
                    610: #
                    611:        .align  2
                    612:        .globl  _Buser
                    613: _Buser:
                    614:        movab   (sp),-(sp)              /* Push pointer to error parameter */
                    615:        callf   $8,_buserror
                    616:        incl    _Berr
                    617:        movl    (sp)+,r0
                    618:        movl    (sp)+,r0
                    619:        rei
                    620: 
                    621: #
                    622: # badaddr(addr, len)
                    623: #      see if access addr with a len type instruction causes a machine check
                    624: #      len is length of access (1=byte, 2=short, 4=long)
                    625: #      r0 = 0 means good(exists); r0 =1 means does not exist.
                    626: #
                    627:        .globl  _badaddr
                    628: _badaddr:
                    629:        .word   0x1c    # Keep r4,r3,r2
                    630:        mfpr    $IPL,r1
                    631:        mtpr    $HIGH,$IPL
                    632:        movl    _scb+BEVEC,r2
                    633:        movl    4(fp),r3
                    634:        movl    8(fp),r4
                    635:        movab   9f,_scb+BEVEC
                    636:        bbc     $0,r4,1f; tstb  (r3)
                    637: 1:     bbc     $1,r4,1f; tstw  (r3)
                    638: 1:     bbc     $2,r4,1f; tstl  (r3)
                    639: 1:     clrl    r0                      # made it w/o machine checks
                    640: 2:     movl    r2,_scb+BEVEC
                    641:        mtpr    r1,$IPL
                    642:        ret
                    643: 
                    644:        .align  2
                    645: 9:                     # Here we catch buss error (if it comes)
                    646:        andl3   4(sp),$0x7,r0   # check ERRCD
                    647:        cmpl    r0,$1           # check APE
                    648:        jneq    1f
                    649:        halt                    # Address parity error !!!
                    650: 1:     cmpl    r0,$5           # check VBE
                    651:        jneq    1f
                    652:        halt                    # Versabus error
                    653: 1:
                    654:        movl    $1,r0           # Anything else = bad address
                    655:        movab   8(sp),sp        # discard buss error trash
                    656:        movab   2b,(sp)         # new program counter on stack.
                    657:        rei
                    658: #
                    659: #
                    660: #
                    661:        .data
                    662:        .align  2
                    663: _Sslr:
                    664:        .long   0
                    665: tst_mask:
                    666:        .long   0
                    667: _bell: .long   0
                    668: _bturn: .long  0
                    669: _btime: .long  0
                    670:        .globl  _Multi
                    671: _Multi:  .long 0
                    672:        .globl  _Berr
                    673: _Berr: .long   0
                    674:        .globl  _IOinit
                    675: _IOinit: .long 0
                    676:        .globl  _tape_ON
                    677: _tape_ON:
                    678:        .long   1
                    679:        .globl  _vioc_ON
                    680: _vioc_ON:
                    681:        .long   1
                    682:        .globl  _vddc_ON
                    683: _vddc_ON:
                    684:        .long   1
                    685:        .globl  _tapes
                    686: _tapes:
                    687:        .long   0
                    688:        .globl  _viocs
                    689: _viocs:
                    690:        .long   0
                    691:        .globl  _vddcs
                    692: _vddcs:
                    693:        .long   0
                    694:        .align  1
                    695: imsg:  .ascii  "\n\nPeripherial Integrated Test System r1.2\n",
                    696:        .ascii  "\nSelect one of the following :\n",
                    697:        .ascii  "\n     0 - Run all test",
                    698:        .ascii  "\n     1 - Tape Master test",
                    699:        .ascii  "\n     2 - VIOC test",
                    700:        .ascii  "\n     3 - VDDC test\n",
                    701:        .ascii  "\nEnter the appropriate test number : \0"
                    702: nmsg:  .ascii  "\n\nNo VIOCs are installed\n\0"

unix.superglobalmegacorp.com

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