Annotation of 43BSDReno/sys/GENERIC.allvax/locore.c, revision 1.1.1.1

1.1       root        1: #define        P_LINK 0
                      2: #define        P_RLINK 4
                      3: #define        P_XLINK 116
                      4: #define        P_ADDR 16
                      5: #define        P_PRI 21
                      6: #define        P_STAT 23
                      7: #define        P_WCHAN 104
                      8: #define        P_TSIZE 72
                      9: #define        P_DSIZE 76
                     10: #define        P_SSIZE 84
                     11: #define        P_P0BR 112
                     12: #define        P_SZPT 70
                     13: #define        P_TEXTP 108
                     14: #define        P_FLAG 44
                     15: #define        SSLEEP 1
                     16: #define        SRUN 3
                     17: #define        UBA_BRRVR 48
                     18: #define        UH_UBA 4
                     19: #define        UH_VEC 28
                     20: #define        UH_SIZE 84
                     21: #define        RP_FLAG 12
                     22: #define        X_CADDR 64
                     23: #define        V_SWTCH 0
                     24: #define        V_TRAP 4
                     25: #define        V_SYSCALL 8
                     26: #define        V_INTR 12
                     27: #define        V_SOFT 16
                     28: #define        V_PDMA 20
                     29: #define        V_FAULTS 92
                     30: #define        V_PGREC 52
                     31: #define        V_FASTPGREC 112
                     32: #define        UPAGES 16
                     33: #define        CLSIZE 2
                     34: #define        MAXPHYS 64512
                     35: #define        SYSPTSIZE 3584
                     36: #define        USRPTSIZE 4096
                     37: #define        MSGBUFPTECNT 8
                     38: #define        MCLBYTES 1024
                     39: #define        NMBCLUSTERS 256
                     40: #define        NKMEMCLUSTERS 512
                     41: #define        U_PROCP 128
                     42: #define        U_RU 1472
                     43: #define        RU_MINFLT 32
                     44: #define        SZ_CMAP 20
                     45: /*
                     46:  * Copyright (c) 1982, 1986 Regents of the University of California.
                     47:  * All rights reserved.  The Berkeley software License Agreement
                     48:  * specifies the terms and conditions for redistribution.
                     49:  *
                     50:  *     @(#)rpb.s       7.1 (Berkeley) 6/5/86
                     51:  */
                     52: 
                     53: /*
                     54:  * This has to get loaded first (physical 0) as 780 memory restart rom
                     55:  * only looks for rpb on a 64K page boundary (doc isn't wrong,
                     56:  * it never says what size "page boundary" rpb has to be on).
                     57:  */
                     58:        .globl  _rpb
                     59: _rpb:
                     60:        .space  508
                     61: erpb:
                     62:        .space  4
                     63: /*
                     64:  * Copyright (c) 1982, 1986 Regents of the University of California.
                     65:  * All rights reserved.  The Berkeley software License Agreement
                     66:  * specifies the terms and conditions for redistribution.
                     67:  *
                     68:  *     @(#)scb.s       7.4 (Berkeley) 5/14/88
                     69:  */
                     70: 
                     71: #include "uba.h"
                     72: 
                     73: /*
                     74:  * System control block
                     75:  */
                     76:        .set    INTSTK,1        # handle this interrupt on the interrupt stack
                     77:        .set    HALT,3          # halt if this interrupt occurs
                     78: 
                     79: _scb:  .globl  _scb
                     80: 
                     81: #define        KS(a)   .long   _X/**/a
                     82: #define        IS(a)   .long   _X/**/a+INTSTK
                     83: #define        STOP(a) .long   _X/**/a+HALT
                     84: 
                     85: #define        STRAY(x)        .long   _scbstray+2*(x)+INTSTK
                     86: #define        STRAY3(n)       STRAY(n);STRAY(n+4);STRAY(n+8)
                     87: #define        STRAY4(n)       STRAY3(n);STRAY(n+12)
                     88: #define        STRAY15(n)      STRAY4(n);STRAY4(n+16);STRAY4(n+32);STRAY3(n+48)
                     89: #define        STRAY16(n)      STRAY15(n);STRAY(n+60)
                     90: #define        NEX0(n) IS(nex0zvec);STRAY15(n+4)
                     91: #define        NEX1(n) IS(nex1zvec);STRAY15(n+4)
                     92: 
                     93: /* 000 */      IS(passiverel); IS(machcheck);  IS(kspnotval);  STOP(powfail);
                     94: /* 010 */      KS(privinflt);  KS(xfcflt);     KS(resopflt);   KS(resadflt);
                     95: /* 020 */      KS(protflt);    KS(transflt);   KS(tracep);     KS(bptflt);
                     96: /* 030 */      KS(compatflt);  KS(arithtrap);  STRAY(0x38);    STRAY(0x3c);
                     97: /* 040 */      KS(syscall);    KS(chme);       KS(chms);       KS(chmu);
                     98: /* 050 */      IS(sbisilo);    IS(cmrd);       IS(sbi0alert);  IS(sbi0fault);
                     99: /* 060 */      IS(wtime);      IS(sbi0fail);   STRAY(0x68);    STRAY(0x6c);
                    100: /* 070 */      STRAY(0x70);    STRAY(0x74);    STRAY(0x78);    STRAY(0x7c);
                    101: /* 080 */      STRAY(0x80);    STRAY(0x84);    KS(astflt);     STRAY(0x8c);
                    102: /* 090 */      STRAY(0x90);    STRAY(0x94);    STRAY(0x98);    STRAY(0x9c);
                    103: /* 0a0 */      IS(softclock);  STRAY(0xa4);    STRAY(0xa8);    STRAY(0xac);
                    104: /* 0b0 */      IS(netintr);    STRAY(0xb4);    STRAY(0xb8);    IS(kdbintr);
                    105: /* 0c0 */      IS(hardclock);  STRAY(0xc4);    KS(emulate);    KS(emulateFPD);
                    106: /* 0d0 */      STRAY(0xd0);    STRAY(0xd4);    STRAY(0xd8);    STRAY(0xdc);
                    107: /* 0e0 */      STRAY(0xe0);    STRAY(0xe4);    STRAY(0xe8);    STRAY(0xec);
                    108: /* 0f0 */      IS(consdin);    IS(consdout);   IS(cnrint);     IS(cnxint);
                    109: /* 100 */      NEX0(0x100);            /* ipl 0x14, nexus 0-15 */
                    110: /* 140 */      NEX0(0x140);            /* ipl 0x15, nexus 0-15 */
                    111: /* 180 */      NEX0(0x180);            /* ipl 0x16, nexus 0-15 */
                    112: /* 1c0 */      NEX0(0x1c0);            /* ipl 0x17, nexus 0-15 */
                    113: 
                    114: /*
                    115:  * 750 hardware reads through UNIvec (scb + 512 bytes) to find Unibus
                    116:  * interrupt vectors.  780s use this space as a jump table (lookup
                    117:  * code in locore.s makes 780s work like 750s).  Additional pages
                    118:  * of interrupt vectors for additional UBAs follow immediately.
                    119:  *
                    120:  * 8600s may use the next page as a second SCB, for which purpose we init
                    121:  * it here.  Everything else will simply replace these with Unibus vectors.
                    122:  * An additional page is provided for UBA jump tables if the second
                    123:  * scb might be present.  Other CPUs with additional scbs should expand
                    124:  * this area as needed.
                    125:  */
                    126:        .globl  _UNIvec
                    127:        .globl  _eUNIvec
                    128: _UNIvec:
                    129: #if VAX8600
                    130: /* 200 */      STRAY16(0x200);         /* unused (?) */
                    131: /* 240 */      STRAY16(0x240);         /* sbi1fail etc. set at boot time */
                    132: /* 280 */      STRAY16(0x280);         /* unused (?) */
                    133: /* 2c0 */      STRAY16(0x2c0);         /* unused (?) */
                    134: /* 300 */      NEX1(0x300);            /* ipl 0x14, nexus 0-15, sbia 1 */
                    135: /* 340 */      NEX1(0x340);            /* ipl 0x15, nexus 0-15, sbia 1 */
                    136: /* 380 */      NEX1(0x380);            /* ipl 0x16, nexus 0-15, sbia 1 */
                    137: /* 3c0 */      NEX1(0x3c0);            /* ipl 0x17, nexus 0-15, sbia 1 */
                    138: 
                    139: #endif
                    140: #if NUBA > 0
                    141:                .space  512*NUBA        # 750 first/second unibus intr vector
                    142:                                        # UBA jump tables on 780's
                    143: #endif
                    144: _eUNIvec:
                    145: #define        I_CLOCK 0
                    146: #define        I_CNR   4
                    147: #define        I_CNX   8
                    148: #define        I_TUR   12
                    149: #define        I_TUX   16
                    150: #define        I_MBA0  20
                    151: #define        I_MBA1  24
                    152: #define        I_MBA2  28
                    153: #define        I_MBA3  32
                    154: #define        I_UBA0  36
                    155: #define        I_UBA1  40
                    156: #define        I_UBA2  44
                    157: #define        I_UBA3  48
                    158: /*
                    159:  * Copyright (c) 1980, 1986 Regents of the University of California.
                    160:  * All rights reserved.  The Berkeley software License Agreement
                    161:  * specifies the terms and conditions for redistribution.
                    162:  *
                    163:  *     @(#)locore.s    7.24 (Berkeley) 5/10/90
                    164:  */
                    165: 
                    166: #include "psl.h"
                    167: #include "pte.h"
                    168: 
                    169: #include "errno.h"
                    170: #include "syscall.h"
                    171: #include "cmap.h"
                    172: 
                    173: #include "mtpr.h"
                    174: #include "trap.h"
                    175: #include "cpu.h"
                    176: #include "nexus.h"
                    177: #include "cons.h"
                    178: #include "clock.h"
                    179: #include "ioa.h"
                    180: #include "ka630.h"
                    181: #include "ka650.h"
                    182: #include "ka820.h"
                    183: #include "../vaxuba/ubareg.h"
                    184: 
                    185: #include "dz.h"
                    186: #include "uu.h"
                    187: #include "ps.h"
                    188: #include "mba.h"
                    189: #include "uba.h"
                    190: 
                    191:        .set    HIGH,0x1f       # mask for total disable
                    192:        .set    MCKVEC,4        # offset into scb of machine check vector
                    193:        .set    NBPG,512
                    194:        .set    PGSHIFT,9
                    195:        .set    SYSTEM,0x80000000       # virtual address of system start
                    196: 
                    197:        .set    NISP,3          # number of interrupt stack pages
                    198: 
                    199: /*
                    200:  * User structure is UPAGES at top of user space.
                    201:  */
                    202:        .globl  _u
                    203:        .set    _u,0x80000000 - UPAGES*NBPG
                    204: 
                    205:        .globl  _intstack
                    206: _intstack:
                    207:        .space  NISP*NBPG
                    208: eintstack:
                    209: 
                    210: /*
                    211:  * Do a dump.
                    212:  * Called by auto-restart.
                    213:  * May be called manually.
                    214:  */
                    215:        .align  2
                    216:        .globl  _doadump
                    217:        .globl  _msgbufmapped
                    218: _doadump:
                    219:        nop; nop                                # .word 0x0101
                    220: #define        _rpbmap _Sysmap                         # rpb, scb, UNIvec[], istack*4
                    221:        bicl2   $PG_PROT,_rpbmap
                    222:        bisl2   $PG_KW,_rpbmap
                    223:        mtpr    $0,$TBIA
                    224:        tstl    _rpb+RP_FLAG                    # dump only once!
                    225:        bneq    1f
                    226:        incl    _rpb+RP_FLAG
                    227:        movl    sp,erpb
                    228:        movab   erpb,sp
                    229:        mfpr    $PCBB,-(sp)
                    230:        mfpr    $MAPEN,-(sp)
                    231:        mfpr    $IPL,-(sp)
                    232:        clrl    _msgbufmapped
                    233:        mtpr    $0,$MAPEN
                    234:        mtpr    $HIGH,$IPL
                    235:        pushr   $0x3fff
                    236:        calls   $0,_dumpsys
                    237: 1:
                    238:        clrl    r11                             # boot flags
                    239:        calls   $0,_vaxboot
                    240:        halt
                    241: 
                    242: /*
                    243:  * Interrupt vector routines
                    244:  */ 
                    245:        .globl  _waittime
                    246: 
                    247: #define        SCBVEC(name)    .align 2; .globl _X/**/name; _X/**/name
                    248: #define        PANIC(msg)      clrl _waittime; pushab 1f; \
                    249:                        calls $1,_panic; 1: .asciz msg
                    250: #define        PRINTF(n,msg)   pushab 1f; calls $n+1,_printf; MSG(msg)
                    251: #define        MSG(msg)        .data; 1: .asciz msg; .text
                    252: #define        PUSHR           pushr $0x3f
                    253: #define        POPR            popr $0x3f
                    254: 
                    255:        .data
                    256: nofault: .long 0       # where to go on predicted machcheck
                    257:        .text
                    258: SCBVEC(machcheck):
                    259:        tstl    nofault
                    260:        bneq    1f
                    261:        PUSHR; pushab 6*4(sp); calls $1,_machinecheck; POPR;
                    262:        addl2 (sp)+,sp; rei
                    263:        .align  2
                    264: 1:
                    265:        casel   _cpu,$1,$VAX_MAX
                    266: 0:
                    267:        .word   8f-0b           # 1 is 780
                    268:        .word   5f-0b           # 2 is 750
                    269:        .word   5f-0b           # 3 is 730
                    270:        .word   7f-0b           # 4 is 8600
                    271:        .word   5f-0b           # 5 is 8200
                    272:        .word   1f-0b           # 6 is 8800 (unsupported)
                    273:        .word   1f-0b           # 7 is 610  (unsupported)
                    274:        .word   1f-0b           # 8 is 630
                    275:        .word   1f-0b           # 9 is ???
                    276:        .word   9f-0b           # 10 is 650
                    277: 5:
                    278: #if defined(VAX8200) || defined(VAX750) || defined(VAX730)
                    279:        mtpr    $0xf,$MCESR
                    280: #endif
                    281:        brb     1f
                    282: 7:
                    283: #if VAX8600
                    284:        mtpr    $0,$EHSR
                    285: #endif
                    286:        brb     1f
                    287: 8:
                    288: #if VAX780
                    289:        mtpr    $0,$SBIFS
                    290: #endif
                    291:        brb     1f
                    292: 9:
                    293: #if VAX650
                    294:        bitl    $PG_V,_KA650MERRmap
                    295:        beql    1f      # don't bother clearing err reg if not mapped in
                    296:        movl    $DSER_CLEAR,_ka650merr+4
                    297: #endif
                    298: 1:
                    299:        addl2   (sp)+,sp                # discard mchchk trash
                    300:        movl    nofault,(sp)
                    301:        rei
                    302: 
                    303: SCBVEC(kspnotval):
                    304:        PANIC("KSP not valid");
                    305: SCBVEC(powfail):
                    306:        halt
                    307: SCBVEC(chme): SCBVEC(chms): SCBVEC(chmu):
                    308:        PANIC("CHM? in kernel");
                    309: 
                    310: SCBVEC(nex0zvec):
                    311:        PUSHR
                    312:        clrl    r0
                    313:        brb     1f
                    314: SCBVEC(nex1zvec):
                    315:        PUSHR
                    316:        movl    $1,r0
                    317: 1:
                    318:        cmpl    _cpu,$VAX_8600          # this is a frill
                    319:        beql    2f
                    320:        mfpr    $IPL,-(sp)
                    321:        PRINTF(1, "nexus stray intr ipl%x\n")
                    322:        POPR
                    323:        rei
                    324: 2:
                    325:        pushl   r0
                    326:        mfpr    $IPL,-(sp)
                    327:        PRINTF(2, "nexus stray intr ipl%x sbia%d\n")
                    328:        POPR
                    329:        rei
                    330: 
                    331: SCBVEC(cmrd):
                    332:        PUSHR; calls $0,_memerr; POPR; rei
                    333: 
                    334: SCBVEC(wtime):                 /* sbi0err on 8600 */
                    335: #if VAX8600
                    336:        cmpl    _cpu,$VAX_8600
                    337:        bneq    wtimo
                    338:        PANIC("sbia0 error")
                    339: wtimo:
                    340: #endif
                    341:        PUSHR; pushl 6*4(sp); PRINTF(1, "write timeout %x\n"); POPR
                    342:        PANIC("wtimo")
                    343: 
                    344: SCBVEC(sbi0fail):
                    345:        PANIC("sbia0 fail")
                    346: SCBVEC(sbi0alert):
                    347: #if VAX8200
                    348:        cmpl    _cpu,$VAX_8200
                    349:        bneq    alert
                    350:        PUSHR; calls $0,_rxcdintr; POPR; rei
                    351: alert:
                    352: #endif
                    353:        PANIC("sbia0 alert")
                    354: SCBVEC(sbi0fault):
                    355:        PANIC("sbia0 fault")
                    356: 
                    357: #ifdef notyet
                    358: #if VAX8600
                    359: SCBVEC(sbi1fail):
                    360:        PANIC("sbia1 fail")
                    361: SCBVEC(sbi1alert):
                    362:        PANIC("sbia1 alert")
                    363: SCBVEC(sbi1fault):
                    364:        PANIC("sbia1 fault")
                    365: SCBVEC(sbi1err):
                    366:        PANIC("sbia1 error")
                    367: #endif
                    368: #endif
                    369: 
                    370: /*
                    371:  * BI 0 bus error (8200), or SBI silo compare error (others)
                    372:  * VMS boot leaves us 1 BI error to ignore.
                    373:  */
                    374: #if VAX8200 && 0
                    375:        .data
                    376:        .align  2
                    377: _ignorebi: .globl _ignorebi
                    378:        .long   1
                    379:        .text
                    380: #endif VAX8200
                    381: 
                    382: SCBVEC(sbisilo):
                    383: #if VAX8200
                    384:        cmpl    _cpu,$VAX_8200
                    385:        bneq    sbisilo
                    386: #if 0
                    387:        blbs    _ignorebi,1f
                    388: #else
                    389:        blbs    _cold,1f
                    390: #endif
                    391:        PUSHR; pushl $0; calls $1,_bi_buserr; POPR
                    392: 1:
                    393:        rei
                    394: #endif
                    395: sbisilo:
                    396:        PANIC("sbi silo compare error")
                    397: 
                    398: /*
                    399:  * SCB stray interrupt catcher.  Compute and print the actual
                    400:  * SCB vector (for fault diagnosis).
                    401:  */
                    402:        .align  2
                    403: _scbstray: .globl _scbstray
                    404: #define        PJ      PUSHR;jsb 1f
                    405:        /* 128 of 'em */
                    406:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    407:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    408:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    409:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    410:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    411:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    412:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    413:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    414: #if VAX8600
                    415:        /* and another 128, for the second SBIA's scb */
                    416:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    417:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    418:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    419:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    420:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    421:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    422:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    423:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    424: #endif
                    425: #undef PJ
                    426: 1:
                    427:        subl3   $_scbstray+8,(sp)+,r0
                    428:        mfpr    $IPL,-(sp)
                    429:        ashl    $-1,r0,-(sp)
                    430: /* call a C handler instead? perhaps later */
                    431:        PRINTF(2, "stray scb intr vec 0x%x ipl%x\n")
                    432:        POPR
                    433:        rei
                    434: 
                    435: #if NMBA > 0
                    436: SCBVEC(mba3int):
                    437:        PUSHR; incl _intrcnt+I_MBA3; pushl $3; brb 1f
                    438: SCBVEC(mba2int):
                    439:        PUSHR; incl _intrcnt+I_MBA2; pushl $2; brb 1f
                    440: SCBVEC(mba1int):
                    441:        PUSHR; incl _intrcnt+I_MBA1; pushl $1; brb 1f
                    442: SCBVEC(mba0int):
                    443:        PUSHR; incl _intrcnt+I_MBA0; pushl $0
                    444: 1:     calls $1,_mbintr
                    445:        POPR
                    446:        incl    _cnt+V_INTR
                    447:        rei
                    448: #endif
                    449: 
                    450: #ifdef DW780
                    451: /*
                    452:  * Registers for the uba handling code
                    453:  */
                    454: #define        rUBANUM r0
                    455: #define        rUBAHD  r1
                    456: #define        rUVEC   r3
                    457: #define        rUBA    r4
                    458: /* r2,r5 are scratch */
                    459: 
                    460: #define        I_UBA   I_UBA0          /* base of UBA interrupt counters */
                    461: 
                    462: #if NUBA > 4
                    463: SCBVEC(ua7int):
                    464:        PUSHR; movl $7,rUBANUM; moval _uba_hd+(7*UH_SIZE),rUBAHD; brb 1f
                    465: SCBVEC(ua6int):
                    466:        PUSHR; movl $6,rUBANUM; moval _uba_hd+(6*UH_SIZE),rUBAHD; brb 1f
                    467: SCBVEC(ua5int):
                    468:        PUSHR; movl $5,rUBANUM; moval _uba_hd+(5*UH_SIZE),rUBAHD; brb 1f
                    469: SCBVEC(ua4int):
                    470:        PUSHR; movl $4,rUBANUM; moval _uba_hd+(4*UH_SIZE),rUBAHD; brb 1f
                    471: #endif
                    472: SCBVEC(ua3int):
                    473:        PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f
                    474: SCBVEC(ua2int):
                    475:        PUSHR; movl $2,rUBANUM; moval _uba_hd+(2*UH_SIZE),rUBAHD; brb 1f
                    476: SCBVEC(ua1int):
                    477:        PUSHR; movl $1,rUBANUM; moval _uba_hd+(1*UH_SIZE),rUBAHD; brb 1f
                    478: SCBVEC(ua0int):
                    479:        PUSHR; movl $0,rUBANUM; moval _uba_hd+(0*UH_SIZE),rUBAHD;
                    480: 1:
                    481:        mfpr    $IPL,r2                         /* r2 = mfpr(IPL); */
                    482:        movl    UH_UBA(rUBAHD),rUBA             /* uba = uhp->uh_uba; */
                    483:        movl    UBA_BRRVR-0x14*4(rUBA)[r2],rUVEC
                    484:                                        /* uvec = uba->uba_brrvr[r2-0x14] */
                    485: ubanorm:
                    486:        bleq    ubaerror 
                    487:        addl2   UH_VEC(rUBAHD),rUVEC            /* uvec += uh->uh_vec */
                    488:        bicl3   $3,(rUVEC),r1 
                    489:        jmp     2(r1)                           /* 2 skips ``pushr $0x3f'' */
                    490: ubaerror:
                    491:        PUSHR; calls $0,_ubaerror; POPR         /* ubaerror r/w's r0-r5 */
                    492:        tstl rUVEC; jneq ubanorm                /* rUVEC contains result */
                    493:        incl _intrcnt+I_UBA[rUBANUM]
                    494:        incl    _cnt+V_INTR
                    495:        POPR
                    496:        rei
                    497: #endif
                    498: SCBVEC(cnrint):
                    499:        PUSHR; calls $0,_cnrint; POPR
                    500:        incl _cnt+V_INTR
                    501:        incl _intrcnt+I_CNR
                    502:        rei
                    503: SCBVEC(cnxint):
                    504:        PUSHR; calls $0,_cnxint; POPR
                    505:        incl _cnt+V_INTR
                    506:        incl _intrcnt+I_CNX
                    507:        rei
                    508: SCBVEC(hardclock):
                    509:        PUSHR
                    510:        mtpr $ICCS_RUN|ICCS_IE|ICCS_INT|ICCS_ERR,$ICCS
                    511: #if NPS > 0
                    512:        pushl   4+6*4(sp); pushl 4+6*4(sp);
                    513:        calls   $2,_psextsync
                    514: #endif
                    515:        pushl 4+6*4(sp); pushl 4+6*4(sp);
                    516:        calls $2,_hardclock                     # hardclock(pc,psl)
                    517:        POPR;
                    518:        incl    _cnt+V_INTR
                    519:        incl    _intrcnt+I_CLOCK
                    520:        rei
                    521: SCBVEC(softclock):
                    522:        PUSHR
                    523:        pushl   4+6*4(sp); pushl 4+6*4(sp);
                    524:        calls   $2,_softclock                   # softclock(pc,psl)
                    525:        POPR; 
                    526:        incl    _cnt+V_SOFT
                    527:        rei
                    528: 
                    529: #include "../net/netisr.h"
                    530:        .globl  _netisr
                    531: SCBVEC(netintr):
                    532:        PUSHR
                    533: #include "imp.h"
                    534: #if NIMP > 0
                    535:        bbcc    $NETISR_IMP,_netisr,1f; calls $0,_impintr; 1:
                    536: #endif
                    537: #ifdef INET
                    538:        bbcc    $NETISR_IP,_netisr,1f; calls $0,_ipintr; 1:
                    539: #endif
                    540: #ifdef NS
                    541:        bbcc    $NETISR_NS,_netisr,1f; calls $0,_nsintr; 1:
                    542: #endif
                    543: #ifdef ISO
                    544:        bbcc    $NETISR_ISO,_netisr,1f; calls $0,_clnlintr; 1:
                    545: #endif
                    546:        POPR
                    547:        incl    _cnt+V_SOFT
                    548:        rei
                    549: 
                    550: SCBVEC(consdin):
                    551:        PUSHR;
                    552:        incl    _intrcnt+I_TUR
                    553:        casel   _cpu,$VAX_750,$VAX_8200
                    554: 0:
                    555:        .word   5f-0b           # 2 is VAX_750
                    556:        .word   3f-0b           # 3 is VAX_730
                    557:        .word   6f-0b           # 4 is VAX_8600
                    558:        .word   7f-0b           # 5 is VAX_8200
                    559:        halt
                    560: 5:
                    561: #if defined(VAX750) && !defined(MRSP)
                    562:        jsb     tudma
                    563: #endif
                    564: 3:
                    565: #if defined(VAX750) || defined(VAX730)
                    566:        calls   $0,_turintr
                    567:        brb     2f
                    568: #else
                    569:        halt
                    570: #endif
                    571: 7:
                    572: #if VAX8200
                    573:        calls   $0,_rx50intr
                    574:        brb     2f
                    575: #else
                    576:        halt
                    577: #endif
                    578: 6:
                    579: #if VAX8600
                    580:        calls   $0,_crlintr
                    581: #else
                    582:        halt
                    583: #endif
                    584: 2:
                    585:        POPR
                    586:        incl    _cnt+V_INTR
                    587:        rei
                    588: 
                    589: #if defined(VAX750) || defined(VAX730)
                    590: SCBVEC(consdout):
                    591:        PUSHR; calls $0,_tuxintr; POPR
                    592:        incl _cnt+V_INTR
                    593:        incl _intrcnt+I_TUX
                    594:        rei
                    595: #else
                    596: SCBVEC(consdout):
                    597:        halt
                    598: #endif
                    599: 
                    600: #if NDZ > 0
                    601: /*
                    602:  * DZ pseudo dma routine:
                    603:  *     r0 - controller number
                    604:  */
                    605:        .align  1
                    606:        .globl  dzdma
                    607: dzdma:
                    608:        mull2   $8*20,r0
                    609:        movab   _dzpdma(r0),r3          # pdma structure base
                    610:                                        # for this controller
                    611: dzploop:
                    612:        movl    r3,r0   
                    613:        movl    (r0)+,r1                # device register address
                    614:        movzbl  1(r1),r2                # get line number
                    615:        bitb    $0x80,r2                # TRDY on?
                    616:        beql    dzprei                  # no    
                    617:        bicb2   $0xf8,r2                # clear garbage bits
                    618:        mull2   $20,r2
                    619:        addl2   r2,r0                   # point at line's pdma structure
                    620:        movl    (r0)+,r2                # p_mem
                    621:        cmpl    r2,(r0)+                # p_mem < p_end ?
                    622:        bgequ   dzpcall                 # no, go call dzxint
                    623:        movb    (r2)+,6(r1)             # dztbuf = *p_mem++
                    624:        movl    r2,-8(r0)
                    625:        brb     dzploop                 # check for another line
                    626: dzprei:
                    627:        POPR
                    628:        incl    _cnt+V_PDMA
                    629:        rei
                    630: 
                    631: dzpcall:
                    632:        pushl   r3
                    633:        pushl   (r0)+                   # push tty address
                    634:        calls   $1,*(r0)                # call interrupt rtn
                    635:        movl    (sp)+,r3
                    636:        brb     dzploop                 # check for another line
                    637: #endif
                    638: 
                    639: #if NUU > 0 && defined(UUDMA)
                    640: /*
                    641:  * Pseudo DMA routine for tu58 (on DL11)
                    642:  *     r0 - controller number
                    643:  */
                    644:        .align  1
                    645:        .globl  uudma
                    646: uudma:
                    647:        movl    _uudinfo[r0],r2
                    648:        movl    16(r2),r2               # r2 = uuaddr
                    649:        mull3   $48,r0,r3
                    650:        movab   _uu_softc(r3),r5        # r5 = uuc
                    651: 
                    652:        cvtwl   2(r2),r1                # c = uuaddr->rdb
                    653:        bbc     $15,r1,1f               # if (c & UUDB_ERROR)
                    654:        movl    $13,16(r5)              #       uuc->tu_state = TUC_RCVERR;
                    655:        rsb                             #       let uurintr handle it
                    656: 1:
                    657:        tstl    4(r5)                   # if (uuc->tu_rcnt) {
                    658:        beql    1f
                    659:        movb    r1,*0(r5)               #       *uuc->tu_rbptr++ = r1
                    660:        incl    (r5)
                    661:        decl    4(r5)                   #       if (--uuc->tu_rcnt)
                    662:        beql    2f                      #               done
                    663:        tstl    (sp)+
                    664:        POPR                            #       registers saved in ubglue.s
                    665:        rei                             # }
                    666: 2:
                    667:        cmpl    16(r5),$8               # if (uuc->tu_state != TUS_GETH)
                    668:        beql    2f                      #       let uurintr handle it
                    669: 1:
                    670:        rsb
                    671: 2:
                    672:        mull2   $14,r0                  # sizeof(uudata[ctlr]) = 14
                    673:        movab   _uudata(r0),r4          # data = &uudata[ctlr];
                    674:        cmpb    $1,(r4)                 # if (data->pk_flag != TUF_DATA)
                    675:        bneq    1b
                    676: #ifdef notdef
                    677:        /* this is for command packets */
                    678:        beql    1f                      #       r0 = uuc->tu_rbptr
                    679:        movl    (r5),r0
                    680:        brb     2f
                    681: 1:                                     # else
                    682: #endif
                    683:        movl    24(r5),r0               #       r0 = uuc->tu_addr
                    684: 2:
                    685:        movzbl  1(r4),r3                # counter to r3 (data->pk_count)
                    686:        movzwl  (r4),r1                 # first word of checksum (=header)
                    687:        mfpr    $IPL,-(sp)              # s = spl5();
                    688:        mtpr    $0x15,$IPL              # to keep disk interrupts out
                    689:        clrw    (r2)                    # disable receiver interrupts
                    690: 3:     bbc     $7,(r2),3b              # while ((uuaddr->rcs & UUCS_READY)==0);
                    691:        cvtwb   2(r2),(r0)+             # *buffer = uuaddr->rdb & 0xff
                    692:        sobgtr  r3,1f                   # continue with next byte ...
                    693:        addw2   2(r2),r1                # unless this was the last (odd count)
                    694:        brb     2f
                    695: 
                    696: 1:     bbc     $7,(r2),1b              # while ((uuaddr->rcs & UUCS_READY)==0);
                    697:        cvtwb   2(r2),(r0)+             # *buffer = uuaddr->rdb & 0xff
                    698:        addw2   -2(r0),r1               # add to checksum..
                    699: 2:
                    700:        adwc    $0,r1                   # get the carry
                    701:        sobgtr  r3,3b                   # loop while r3 > 0
                    702: /*
                    703:  * We're ready to get the checksum
                    704:  */
                    705: 1:     bbc     $7,(r2),1b              # while ((uuaddr->rcs & UUCS_READY)==0);
                    706:        cvtwb   2(r2),12(r4)            # get first (lower) byte
                    707: 1:     bbc     $7,(r2),1b
                    708:        cvtwb   2(r2),13(r4)            # ..and second
                    709:        cmpw    12(r4),r1               # is checksum ok?
                    710:        beql    1f
                    711:        movl    $14,16(r5)              # uuc->tu_state = TUS_CHKERR
                    712:        brb     2f                      # exit
                    713: 1:
                    714:        movl    $11,16(r5)              # uuc->tu_state = TUS_GET (ok)
                    715: 2:
                    716:        movw    $0x40,(r2)              # enable receiver interrupts
                    717:        mtpr    (sp)+,$IPL              # splx(s);
                    718:        rsb                             # continue processing in uurintr
                    719: #endif
                    720: 
                    721: #if defined(VAX750) && !defined(MRSP)
                    722: /*
                    723:  * Pseudo DMA routine for VAX-11/750 console tu58 
                    724:  *         (without MRSP)
                    725:  */
                    726:        .align  1
                    727:        .globl  tudma
                    728: tudma:
                    729:        movab   _tu,r5                  # r5 = tu
                    730:        tstl    4(r5)                   # if (tu.tu_rcnt) {
                    731:        beql    3f
                    732:        mfpr    $CSRD,r1                # get data from tu58
                    733:        movb    r1,*0(r5)               #       *tu.tu_rbptr++ = r1
                    734:        incl    (r5)
                    735:        decl    4(r5)                   #       if (--tu.tu_rcnt)
                    736:        beql    1f                      #               done
                    737:        tstl    (sp)+
                    738:        POPR                            #       registers saved in ubglue.s
                    739:        rei                             #       data handled, done
                    740: 1:                                     # }
                    741:        cmpl    16(r5),$8               # if (tu.tu_state != TUS_GETH)
                    742:        beql    2f                      #       let turintr handle it
                    743: 3:
                    744:        rsb
                    745: 2:
                    746:        movab   _tudata,r4              # r4 = tudata
                    747:        cmpb    $1,(r4)                 # if (tudata.pk_flag != TUF_DATA)
                    748:        bneq    3b                      #       let turintr handle it
                    749: 1:                                     # else
                    750:        movl    24(r5),r1               # get buffer pointer to r1
                    751:        movzbl  1(r4),r3                # counter to r3
                    752:        movzwl  (r4),r0                 # first word of checksum (=header)
                    753:        mtpr    $0,$CSRS                # disable receiver interrupts
                    754: 3:
                    755:        bsbw    5f                      # wait for next byte
                    756:        mfpr    $CSRD,r5
                    757:        movb    r5,(r1)+                # *buffer = rdb
                    758:        sobgtr  r3,1f                   # continue with next byte ...
                    759:        mfpr    $CSRD,r2                # unless this was the last (odd count)
                    760:        brb     2f
                    761: 
                    762: 1:     bsbw    5f                      # wait for next byte
                    763:        mfpr    $CSRD,r5
                    764:        movb    r5,(r1)+                # *buffer = rdb
                    765:        movzwl  -2(r1),r2               # get the last word back from memory
                    766: 2:
                    767:        addw2   r2,r0                   # add to checksum..
                    768:        adwc    $0,r0                   # get the carry
                    769:        sobgtr  r3,3b                   # loop while r3 > 0
                    770: /*
                    771:  * We're ready to get the checksum.
                    772:  */
                    773:        bsbw    5f
                    774:        movab   _tudata,r4
                    775:        mfpr    $CSRD,r5
                    776:        movb    r5,12(r4)               # get first (lower) byte
                    777:        bsbw    5f
                    778:        mfpr    $CSRD,r5
                    779:        movb    r5,13(r4)               # ..and second
                    780:        movab   _tu,r5
                    781:        cmpw    12(r4),r0               # is checksum ok?
                    782:        beql    1f
                    783:        movl    $14,16(r5)              # tu.tu_state = TUS_CHKERR
                    784:        brb     2f                      # exit
                    785: 1:
                    786:        movl    $11,16(r5)              # tu.tu_state = TUS_GET
                    787: 2:
                    788:        mtpr    $0x40,$CSRS             # enable receiver interrupts
                    789:        rsb                             # continue processing in turintr
                    790: /*
                    791:  * Loop until a new byte is ready from
                    792:  * the tu58, make sure we don't loop forever
                    793:  */
                    794: 5:
                    795:        movl    $5000,r5                # loop max 5000 times
                    796: 1:
                    797:        mfpr    $CSRS,r2
                    798:        bbs     $7,r2,1f
                    799:        sobgtr  r5,1b
                    800:        movab   _tu,r5
                    801:        movl    $13,16(r5)              # return TUS_RCVERR
                    802:        tstl    (sp)+                   # and let turintr handle it
                    803: 1:
                    804:        rsb
                    805: #endif
                    806: 
                    807: /*
                    808:  * BI passive release things.
                    809:  */
                    810: SCBVEC(passiverel):
                    811:        rei                             # well that was useless
                    812: 
                    813: /*
                    814:  * Stray UNIBUS interrupt catch routines
                    815:  */
                    816:        .data
                    817:        .align  2
                    818: #define        PJ      PUSHR;jsb _Xustray
                    819:        .globl  _catcher
                    820: _catcher:
                    821:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    822:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    823:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    824:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    825:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    826:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    827:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    828:        PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ
                    829: 
                    830:        .globl  _cold
                    831:        .globl  _br
                    832:        .globl  _cvec
                    833: _cold: .long   1
                    834: _br:   .long   0
                    835: _cvec: .long   0
                    836: 
                    837:        .text
                    838: SCBVEC(ustray):
                    839:        blbc    _cold,1f
                    840:        mfpr    $IPL,r11
                    841:        movl    r11,_br
                    842:        subl3   $_catcher+8,(sp)+,r10
                    843:        ashl    $-1,r10,r10
                    844:        movl    r10,_cvec
                    845:        POPR
                    846:        rei
                    847: 1:
                    848:        subl3   $_catcher+8,(sp)+,r0
                    849:        ashl    $-1,r0,-(sp)
                    850:        mfpr    $IPL,-(sp)
                    851:        PRINTF(2, "uba?: stray intr ipl %x vec %o\n")
                    852:        POPR
                    853:        rei
                    854: 
                    855: #if VAX630 || VAX650
                    856: /*
                    857:  * Emulation OpCode jump table:
                    858:  *     ONLY GOES FROM 0xf8 (-8) TO 0x3B (59)
                    859:  */
                    860: #define EMUTABLE       0x43
                    861: #define NOEMULATE      .long noemulate
                    862: #define        EMULATE(a)      .long _EM/**/a
                    863:        .globl  _emJUMPtable
                    864: _emJUMPtable:
                    865: /* f8 */       EMULATE(ashp);  EMULATE(cvtlp); NOEMULATE;      NOEMULATE
                    866: /* fc */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    867: /* 00 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    868: /* 04 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    869: /* 08 */       EMULATE(cvtps); EMULATE(cvtsp); NOEMULATE;      EMULATE(crc)
                    870: /* 0c */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    871: /* 10 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    872: /* 14 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    873: /* 18 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    874: /* 1c */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    875: /* 20 */       EMULATE(addp4); EMULATE(addp6); EMULATE(subp4); EMULATE(subp6)
                    876: /* 24 */       EMULATE(cvtpt); EMULATE(mulp);  EMULATE(cvttp); EMULATE(divp)
                    877: /* 28 */       NOEMULATE;      EMULATE(cmpc3); EMULATE(scanc); EMULATE(spanc)
                    878: /* 2c */       NOEMULATE;      EMULATE(cmpc5); EMULATE(movtc); EMULATE(movtuc)
                    879: /* 30 */       NOEMULATE;      NOEMULATE;      NOEMULATE;      NOEMULATE
                    880: /* 34 */       EMULATE(movp);  EMULATE(cmpp3); EMULATE(cvtpl); EMULATE(cmpp4)
                    881: /* 38 */       EMULATE(editpc); EMULATE(matchc); EMULATE(locc); EMULATE(skpc)
                    882: #endif
                    883: 
                    884: /*
                    885:  * Trap and fault vector routines
                    886:  */ 
                    887: #define        TRAP(a) pushl $T_/**/a; jbr alltraps
                    888: 
                    889: /*
                    890:  * Ast delivery (profiling and/or reschedule)
                    891:  */
                    892: SCBVEC(astflt):
                    893:        pushl $0; TRAP(ASTFLT)
                    894: SCBVEC(privinflt):
                    895:        pushl $0; TRAP(PRIVINFLT)
                    896: SCBVEC(xfcflt):
                    897:        pushl $0; TRAP(XFCFLT)
                    898: SCBVEC(resopflt):
                    899:        pushl $0; TRAP(RESOPFLT)
                    900: SCBVEC(resadflt):
                    901:        pushl $0; TRAP(RESADFLT)
                    902: SCBVEC(bptflt):
                    903:        pushl $0; TRAP(BPTFLT)
                    904: SCBVEC(compatflt):
                    905:        TRAP(COMPATFLT);
                    906: SCBVEC(kdbintr):
                    907:        pushl $0; TRAP(KDBTRAP)
                    908: SCBVEC(tracep):
                    909:        pushl $0; TRAP(TRCTRAP)
                    910: SCBVEC(arithtrap):
                    911:        TRAP(ARITHTRAP)
                    912: SCBVEC(protflt):
                    913:        blbs    (sp)+,segflt
                    914:        TRAP(PROTFLT)
                    915: segflt:
                    916:        TRAP(SEGFLT)
                    917: 
                    918: /*
                    919:  * The following is called with the stack set up as follows:
                    920:  *
                    921:  *       (sp): Opcode
                    922:  *      4(sp): Instruction PC
                    923:  *      8(sp): Operand 1
                    924:  *     12(sp): Operand 2
                    925:  *     16(sp): Operand 3
                    926:  *     20(sp): Operand 4
                    927:  *     24(sp): Operand 5
                    928:  *     28(sp): Operand 6
                    929:  *     32(sp): Operand 7 (unused)
                    930:  *     36(sp): Operand 8 (unused)
                    931:  *     40(sp): Return PC
                    932:  *     44(sp): Return PSL
                    933:  *     48(sp): TOS before instruction
                    934:  *
                    935:  * Each individual routine is called with the stack set up as follows:
                    936:  *
                    937:  *       (sp): Return address of trap handler
                    938:  *      4(sp): Opcode (will get return PSL)
                    939:  *      8(sp): Instruction PC
                    940:  *     12(sp): Operand 1
                    941:  *     16(sp): Operand 2
                    942:  *     20(sp): Operand 3
                    943:  *     24(sp): Operand 4
                    944:  *     28(sp): Operand 5
                    945:  *     32(sp): Operand 6
                    946:  *     36(sp): saved register 11
                    947:  *     40(sp): saved register 10
                    948:  *     44(sp): Return PC
                    949:  *     48(sp): Return PSL
                    950:  *     52(sp): TOS before instruction
                    951:  */
                    952: 
                    953: SCBVEC(emulate):
                    954: #if VAX630 || VAX650
                    955:        movl    r11,32(sp)              # save register r11 in unused operand
                    956:        movl    r10,36(sp)              # save register r10 in unused operand
                    957:        cvtbl   (sp),r10                # get opcode
                    958:        addl2   $8,r10                  # shift negative opcodes
                    959:        subl3   r10,$EMUTABLE,r11       # forget it if opcode is out of range
                    960:        bcs     noemulate
                    961:        movl    _emJUMPtable[r10],r10   # call appropriate emulation routine
                    962:        jsb     (r10)           # routines put return values into regs 0-5
                    963:        movl    32(sp),r11              # restore register r11
                    964:        movl    36(sp),r10              # restore register r10
                    965:        insv    (sp),$0,$4,44(sp)       # and condition codes in Opcode spot
                    966:        addl2   $40,sp                  # adjust stack for return
                    967:        rei
                    968: noemulate:
                    969:        addl2   $48,sp                  # adjust stack for
                    970: #endif
                    971:        .word   0xffff                  # "reserved instruction fault"
                    972: SCBVEC(emulateFPD):
                    973:        .word   0xffff                  # "reserved instruction fault"
                    974: SCBVEC(transflt):
                    975:        bitl    $2,(sp)+
                    976:        bnequ   tableflt
                    977:        jsb     Fastreclaim             # try and avoid pagein
                    978:        TRAP(PAGEFLT)
                    979: tableflt: 
                    980:        TRAP(TABLEFLT)
                    981: 
                    982: alltraps:
                    983:        mfpr    $USP,-(sp); calls $0,_trap; mtpr (sp)+,$USP
                    984:        incl    _cnt+V_TRAP
                    985:        addl2   $8,sp                   # pop type, code
                    986:        mtpr    $HIGH,$IPL              ## dont go to a higher IPL (GROT)
                    987:        rei
                    988: 
                    989: SCBVEC(syscall):
                    990:        pushl   $T_SYSCALL
                    991:        mfpr    $USP,-(sp); calls $0,_syscall; mtpr (sp)+,$USP
                    992:        incl    _cnt+V_SYSCALL
                    993:        addl2   $8,sp                   # pop type, code
                    994:        mtpr    $HIGH,$IPL              ## dont go to a higher IPL (GROT)
                    995:        rei
                    996: 
                    997: /*
                    998:  * System page table
                    999:  * Mbmap and Usrptmap are enlarged by CLSIZE entries
                   1000:  * as they are managed by resource maps starting with index 1 or CLSIZE.
                   1001:  */ 
                   1002: #define        vaddr(x)        ((((x)-_Sysmap)/4)*NBPG+0x80000000)
                   1003: #define        SYSMAP(mname, vname, npte)                      \
                   1004: _/**/mname:    .globl  _/**/mname;             \
                   1005:        .space  (npte)*4;                               \
                   1006:        .globl  _/**/vname;                     \
                   1007:        .set    _/**/vname,vaddr(_/**/mname)
                   1008: #define        ADDMAP(npte)    .space  (npte)*4
                   1009: 
                   1010:        .data
                   1011:        .align  2
                   1012:        SYSMAP(Sysmap   ,Sysbase        ,SYSPTSIZE      )
                   1013:        SYSMAP(Forkmap  ,forkutl        ,UPAGES         )
                   1014:        SYSMAP(Xswapmap ,xswaputl       ,UPAGES         )
                   1015:        SYSMAP(Xswap2map,xswap2utl      ,UPAGES         )
                   1016:        SYSMAP(Swapmap  ,swaputl        ,UPAGES         )
                   1017:        SYSMAP(Pushmap  ,pushutl        ,UPAGES         )
                   1018:        SYSMAP(Vfmap    ,vfutl          ,UPAGES         )
                   1019:        SYSMAP(CMAP1    ,CADDR1         ,1              )
                   1020:        SYSMAP(CMAP2    ,CADDR2         ,1              )
                   1021:        SYSMAP(mmap     ,vmmap          ,1              )
                   1022:        SYSMAP(alignmap ,alignutl       ,1              )       /* XXX */
                   1023:        SYSMAP(msgbufmap,msgbuf         ,MSGBUFPTECNT   )
                   1024:        SYSMAP(Mbmap    ,mbutl          ,NMBCLUSTERS*MCLBYTES/NBPG+CLSIZE )
                   1025: #ifdef MFS
                   1026: #include "../ufs/mfsiom.h"
                   1027:        /*
                   1028:         * Used by the mfs_doio() routine for physical I/O
                   1029:         */
                   1030:        SYSMAP(Mfsiomap ,mfsiobuf       ,MFS_MAPREG )
                   1031: #endif /* MFS */
                   1032: #ifdef NFS
                   1033: #include "../nfs/nfsiom.h"
                   1034:        /*
                   1035:         * Used by the nfs_doio() routine for physical I/O
                   1036:         */
                   1037:        SYSMAP(Nfsiomap ,nfsiobuf       ,NFS_MAPREG )
                   1038: #endif /* NFS */
                   1039:        /*
                   1040:         * This is the map used by the kernel memory allocator.
                   1041:         * It is expanded as necessary by the special features
                   1042:         * that use it.
                   1043:         *
                   1044:         * XXX: NEED way to compute kmem size from maxusers,
                   1045:         * device complement
                   1046:         */
                   1047:        SYSMAP(kmempt   ,kmembase       ,NKMEMCLUSTERS*CLSIZE )
                   1048: #ifdef SYSVSHM
                   1049:                                ADDMAP( SHMMAXPGS       )
                   1050: #endif
                   1051: #ifdef GPROF
                   1052:                                ADDMAP( 600*CLSIZE      )
                   1053: #endif
                   1054:        SYSMAP(ekmempt  ,kmemlimit      ,0              )
                   1055: 
                   1056:        SYSMAP(UMBAbeg  ,umbabeg        ,0              )
                   1057:        SYSMAP(Nexmap   ,nexus          ,16*MAXNNEXUS   )
                   1058: #ifdef QBA
                   1059: #if (QBAPAGES+UBAIOPAGES) > (UBAPAGES+UBAIOPAGES)*NUBA 
                   1060:        SYSMAP(UMEMmap  ,umem           ,(QBAPAGES+UBAIOPAGES) )
                   1061: #else
                   1062:        SYSMAP(UMEMmap  ,umem           ,(UBAPAGES+UBAIOPAGES)*NUBA )
                   1063: #endif
                   1064: #else /* QBA */
                   1065:        SYSMAP(UMEMmap  ,umem           ,(UBAPAGES+UBAIOPAGES)*NUBA )
                   1066: #endif /* QBA */
                   1067: #if VAX8600
                   1068:        SYSMAP(Ioamap   ,ioa            ,MAXNIOA*IOAMAPSIZ/NBPG )
                   1069: #endif
                   1070: #if VAX8200 || VAX630
                   1071:        SYSMAP(Clockmap ,ka630clock     ,1              )
                   1072: #endif
                   1073: #if VAX8200
                   1074:        /* alas, the clocks on the 8200 and 630 are not quite identical */
                   1075:        /* they could be shared for now, but this seemed cleaner */
                   1076:        .globl _ka820clock; .set _ka820clock,_ka630clock
                   1077:        SYSMAP(Ka820map ,ka820port      ,1              )
                   1078:        SYSMAP(RX50map  ,rx50device     ,1              )
                   1079: #ifdef notyet
                   1080:        SYSMAP(BRAMmap  ,ka820bootram   ,KA820_BRPAGES  )
                   1081:        SYSMAP(EEPROMmap,ka820eeprom    ,KA820_EEPAGES  )
                   1082: #endif
                   1083: #endif
                   1084: #if VAX630
                   1085:        SYSMAP(Ka630map ,ka630cpu       ,1              )
                   1086: #endif
                   1087: #if VAX650
                   1088:        SYSMAP(KA650MERRmap     ,ka650merr      ,1              )
                   1089:        SYSMAP(KA650CBDmap      ,ka650cbd       ,1              )
                   1090:        SYSMAP(KA650SSCmap      ,ka650ssc       ,3              )
                   1091:        SYSMAP(KA650IPCRmap     ,ka650ipcr      ,1              )
                   1092:        SYSMAP(KA650CACHEmap    ,ka650cache     ,KA650_CACHESIZE/NBPG )
                   1093: #endif
                   1094: #ifdef QBA
                   1095:        /*
                   1096:         * qvss and qdss don't coexist - one map will suffice
                   1097:         * for either. qvss is 256K each and qdss is 64K each.
                   1098:         */
                   1099: #include "qv.h"
                   1100: #include "qd.h"
                   1101: #if NQV > 0 || NQD > 0
                   1102:        SYSMAP(QVmap    ,qvmem          ,((512*NQV)+(128*NQD)))
                   1103: #endif
                   1104: #endif
                   1105:        SYSMAP(UMBAend  ,umbaend        ,0              )
                   1106: 
                   1107:        SYSMAP(Usrptmap ,usrpt          ,USRPTSIZE+CLSIZE )
                   1108: 
                   1109: eSysmap:
                   1110:        .globl  _Syssize
                   1111:        .set    _Syssize,(eSysmap-_Sysmap)/4
                   1112:        .text
                   1113: 
                   1114: /*
                   1115:  * Initialization
                   1116:  *
                   1117:  * ipl 0x1f; mapen 0; scbb, pcbb, sbr, slr, isp, ksp not set
                   1118:  */
                   1119:        .data
                   1120:        .globl  _cpu
                   1121: _cpu:  .long   0
                   1122:        .text
                   1123:        .globl  start
                   1124: start:
                   1125:        .word   0
                   1126:        mtpr    $0,$ICCS
                   1127: /* set system control block base and system page table params */
                   1128:        mtpr    $_scb-0x80000000,$SCBB
                   1129:        mtpr    $_Sysmap-0x80000000,$SBR
                   1130:        mtpr    $_Syssize,$SLR
                   1131: /* double map the kernel into the virtual user addresses of phys mem */
                   1132:        mtpr    $_Sysmap,$P0BR
                   1133:        mtpr    $_Syssize,$P0LR
                   1134: /* set ISP and get cpu type */
                   1135:        movl    $_intstack+NISP*NBPG,sp
                   1136:        mfpr    $SID,r0
                   1137:        movab   _cpu,r1
                   1138:        extzv   $24,$8,r0,(r1)
                   1139: /* init RPB */
                   1140:        movab   _rpb,r0
                   1141:        movl    r0,(r0)+                        # rp_selfref
                   1142:        movab   _doadump,r1
                   1143:        movl    r1,(r0)+                        # rp_dumprout
                   1144:        movl    $0x1f,r2
                   1145:        clrl    r3
                   1146: 1:     addl2   (r1)+,r3; sobgtr r2,1b
                   1147:        movl    r3,(r0)+                        # rp_chksum
                   1148: /* count up memory; _physmem contains limit */
                   1149:        clrl    r7
                   1150:        ashl    $PGSHIFT,_physmem,r8
                   1151:        decl    r8
                   1152: 1:     pushl   $4; pushl r7; calls $2,_badaddr; tstl r0; bneq 9f
                   1153:        acbl    r8,$64*1024,r7,1b
                   1154: 9:
                   1155: #if  VAX630 || VAX650
                   1156: /* reserve area at top of memory for processor specific use */
                   1157:        cmpb    _cpu,$VAX_630
                   1158:        beql    1f
                   1159:        cmpb    _cpu,$VAX_650
                   1160:        bneq    2f
                   1161:        subl2   $32768,r7       # space for Qbus map registers
                   1162:        brb     2f
                   1163: 1:
                   1164:        subl2   $4096,r7        # space for console scratchpad
                   1165: 2:
                   1166: #endif
                   1167: /* clear memory from kernel bss and pages for proc 0 u. and page table */
                   1168:        movab   _edata,r6; bicl2 $SYSTEM,r6
                   1169:        movab   _end,r5; bicl2 $SYSTEM,r5
                   1170: #ifdef KADB
                   1171:        subl2   $4,r5
                   1172: 1:     clrl    (r6); acbl r5,$4,r6,1b          # clear just bss
                   1173:        addl2   $4,r5
                   1174:        bbc     $6,r11,0f                       # check RB_KDB
                   1175:        bicl3   $SYSTEM,r9,r5                   # skip symbol & string tables
                   1176:        bicl3   $SYSTEM,r9,r6                   # r9 obtained from boot
                   1177: #endif
                   1178: 0:     bisl3   $SYSTEM,r5,r9                   # convert to virtual address
                   1179:        addl2   $NBPG-1,r9                      # roundup to next page
                   1180:        addl2   $(UPAGES*NBPG)+NBPG+NBPG,r5
                   1181: 1:     clrq    (r6); acbl r5,$8,r6,1b
                   1182: /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */
                   1183: /* panic() is convenient place to save all for debugging */
                   1184:        bisw2   $0x0fff,_trap
                   1185:        bisw2   $0x0fff,_syscall
                   1186:        bisw2   $0x0fff,_panic
                   1187:        calls   $0,_fixctlrmask
                   1188: /* initialize system page table: uba vectors and int stack writeable */
                   1189:        clrl    r2
                   1190:        movab   eintstack,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1
                   1191: 1:     bisl3   $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b
                   1192: /*
                   1193:  * make rpb read-only as red zone for interrupt stack
                   1194:  * (scb(s) and UNIvec are write-protected later)
                   1195:  */
                   1196:        bicl2   $PG_PROT,_rpbmap
                   1197:        bisl2   $PG_KR,_rpbmap
                   1198: /* make kernel text space read-only */
                   1199:        movab   _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1
                   1200: 1:     bisl3   $PG_V|PG_URKR,r2,_Sysmap[r2]; aoblss r1,r2,1b
                   1201: /* make kernel data, bss, read-write */
                   1202:        bicl3   $SYSTEM,r9,r1; ashl $-PGSHIFT,r1,r1
                   1203: 1:     bisl3   $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b
                   1204: /* now go to mapped mode */
                   1205:        mtpr    $0,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0:
                   1206: /* init mem sizes */
                   1207:        ashl    $-PGSHIFT,r7,_physmem
                   1208: /* setup context for proc[0] == Scheduler */
                   1209:        bicl3   $SYSTEM|(NBPG-1),r9,r6  # make phys, page boundary
                   1210: /* setup page table for proc[0] */
                   1211:        ashl    $-PGSHIFT,r6,r3                 # r3 = btoc(r6)
                   1212:        bisl3   $PG_V|PG_KW,r3,_Usrptmap        # init first upt entry
                   1213:        incl    r3
                   1214:        movab   _usrpt,r0
                   1215:        mtpr    r0,$TBIS
                   1216: /* init p0br, p0lr */
                   1217:        mtpr    r0,$P0BR
                   1218:        mtpr    $0,$P0LR
                   1219: /* init p1br, p1lr */
                   1220:        movab   NBPG(r0),r0
                   1221:        movl    $0x200000-UPAGES,r1
                   1222:        mtpr    r1,$P1LR
                   1223:        mnegl   r1,r1
                   1224:        moval   -4*UPAGES(r0)[r1],r2
                   1225:        mtpr    r2,$P1BR
                   1226: /* setup mapping for UPAGES of _u */
                   1227:        movl    $UPAGES,r2; movab _u+NBPG*UPAGES,r1; addl2 $UPAGES,r3; jbr 2f
                   1228: 1:     decl    r3
                   1229:        moval   -NBPG(r1),r1;
                   1230:        bisl3   $PG_V|PG_URKW,r3,-(r0)
                   1231:        mtpr    r1,$TBIS
                   1232: 2:     sobgeq  r2,1b
                   1233: /* initialize (slightly) the pcb */
                   1234:        movab   UPAGES*NBPG(r1),PCB_KSP(r1)
                   1235:        mnegl   $1,PCB_ESP(r1)
                   1236:        mnegl   $1,PCB_SSP(r1)
                   1237:        movl    r1,PCB_USP(r1)
                   1238:        mfpr    $P0BR,PCB_P0BR(r1)
                   1239:        mfpr    $P0LR,PCB_P0LR(r1)
                   1240:        movb    $4,PCB_P0LR+3(r1)               # disable ast
                   1241:        mfpr    $P1BR,PCB_P1BR(r1)
                   1242:        mfpr    $P1LR,PCB_P1LR(r1)
                   1243:        movl    $CLSIZE,PCB_SZPT(r1)            # init u.u_pcb.pcb_szpt
                   1244:        movl    r9,PCB_R9(r1)
                   1245:        movl    r10,PCB_R10(r1)
                   1246:        movl    r11,PCB_R11(r1)
                   1247:        movab   1f,PCB_PC(r1)                   # initial pc
                   1248:        clrl    PCB_PSL(r1)                     # mode(k,k), ipl=0
                   1249:        ashl    $PGSHIFT,r3,r3
                   1250:        mtpr    r3,$PCBB                        # first pcbb
                   1251: /* set regs, p0br, p0lr, p1br, p1lr, astlvl, ksp and change to kernel mode */
                   1252:        ldpctx
                   1253:        rei
                   1254: /* put signal trampoline code in u. area */
                   1255: 1:     movab   _u,r0
                   1256:        movc3   $19,sigcode,PCB_SIGC(r0)
                   1257: /* save boot device in global _bootdev */
                   1258:        movl    r10,_bootdev
                   1259: /* save reboot flags in global _boothowto */
                   1260:        movl    r11,_boothowto
                   1261: #ifdef KADB
                   1262: /* save end of symbol & string table in global _bootesym */
                   1263:        subl3   $NBPG-1,r9,_bootesym
                   1264: #endif
                   1265: /* calculate firstaddr, and call main() */
                   1266:        bicl3   $SYSTEM,r9,r0; ashl $-PGSHIFT,r0,-(sp)
                   1267:        addl2   $UPAGES+1,(sp); calls $1,_main
                   1268: /* proc[1] == /etc/init now running here; run icode */
                   1269:        pushl   $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei
                   1270: 
                   1271: /* signal trampoline code: it is known that this code takes exactly 19 bytes */
                   1272: /* in ../vax/pcb.h and in the movc3 above */
                   1273: sigcode:
                   1274:        calls   $4,8(pc)        # params pushed by sendsig
                   1275:        movl    sp,ap           # calls frame built by sendsig
                   1276:        chmk    $SYS_sigreturn  # cleanup mask and onsigstack
                   1277:        halt                    # sigreturn() does not return!
                   1278:        .word   0x3f            # registers 0-5
                   1279:        callg   (ap),*16(ap)    # call the signal handler
                   1280:        ret                     # return to code above
                   1281: 
                   1282:        .globl  _icode
                   1283:        .globl  _initflags
                   1284:        .globl  _szicode
                   1285: /*
                   1286:  * Icode is copied out to process 1 to exec /etc/init.
                   1287:  * If the exec fails, process 1 exits.
                   1288:  */
                   1289: _icode:
                   1290:        pushab  b`argv-l0(pc)
                   1291: l0:    pushab  b`init-l1(pc)
                   1292: l1:    pushl   $2
                   1293:        movl    sp,ap
                   1294:        chmk    $SYS_execv
                   1295:        pushl   r0
                   1296:        chmk    $SYS_exit
                   1297: 
                   1298: init:  .asciz  "/sbin/init"
                   1299:        .align  2
                   1300: _initflags:
                   1301:        .long   0
                   1302: argv:  .long   init+6-_icode
                   1303:        .long   _initflags-_icode
                   1304:        .long   0
                   1305: _szicode:
                   1306:        .long   _szicode-_icode
                   1307: 
                   1308: /*
                   1309:  * Primitives
                   1310:  */ 
                   1311: 
                   1312: #ifdef GPROF
                   1313: #define        ENTRY(name, regs) \
                   1314:        .globl _/**/name; .align 1; _/**/name: .word regs; jsb mcount
                   1315: #define        JSBENTRY(name, regs) \
                   1316:        .globl _/**/name; _/**/name: \
                   1317:        movl fp,-(sp); movab -12(sp),fp; pushr $(regs); jsb mcount; \
                   1318:        popr $(regs); movl (sp)+,fp
                   1319: #else
                   1320: #define        ENTRY(name, regs) \
                   1321:        .globl _/**/name; .align 1; _/**/name: .word regs
                   1322: #define        JSBENTRY(name, regs) \
                   1323:        .globl _/**/name; _/**/name:
                   1324: #endif GPROF
                   1325: #define R0 0x01
                   1326: #define R1 0x02
                   1327: #define R2 0x04
                   1328: #define R3 0x08
                   1329: #define R4 0x10
                   1330: #define R5 0x20
                   1331: #define R6 0x40
                   1332: 
                   1333: /*
                   1334:  * badaddr(addr, len)
                   1335:  *     see if access addr with a len type instruction causes a machine check
                   1336:  *     len is length of access (1=byte, 2=short, 4=long)
                   1337:  */
                   1338:        .globl  _badaddr
                   1339: _badaddr:
                   1340:        .word   0
                   1341:        movl    $1,r0
                   1342:        mfpr    $IPL,r1
                   1343:        mtpr    $HIGH,$IPL
                   1344:        movl    4(ap),r3
                   1345:        movl    8(ap),r4
                   1346:        movab   2f,nofault              # jump to 2f on machcheck
                   1347:        bbc     $0,r4,1f; tstb  (r3)
                   1348: 1:     bbc     $1,r4,1f; tstw  (r3)
                   1349: 1:     bbc     $2,r4,1f; tstl  (r3)
                   1350: 1:     clrl    r0                      # made it w/o machine checks
                   1351: 2:     clrl    nofault
                   1352:        mtpr    r1,$IPL
                   1353:        ret
                   1354: 
                   1355: /*
                   1356:  * update profiling information for the user
                   1357:  * addupc(pc, &u.u_prof, ticks)
                   1358:  */
                   1359: ENTRY(addupc, 0)
                   1360:        movl    8(ap),r2                # &u.u_prof
                   1361:        subl3   8(r2),4(ap),r0          # corrected pc
                   1362:        blss    9f
                   1363:        extzv   $1,$31,r0,r0            # logical right shift
                   1364:        extzv   $1,$31,12(r2),r1        # ditto for scale
                   1365:        emul    r1,r0,$0,r0
                   1366:        ashq    $-14,r0,r0
                   1367:        tstl    r1
                   1368:        bneq    9f
                   1369:        bicl2   $1,r0
                   1370:        cmpl    r0,4(r2)                # length
                   1371:        bgequ   9f
                   1372:        addl2   (r2),r0                 # base
                   1373:        probew  $3,$2,(r0)
                   1374:        beql    8f
                   1375:        addw2   12(ap),(r0)
                   1376: 9:
                   1377:        ret
                   1378: 8:
                   1379:        clrl    12(r2)
                   1380:        ret
                   1381: 
                   1382: /*
                   1383:  * Copy a null terminated string from the user address space into
                   1384:  * the kernel address space.
                   1385:  *
                   1386:  * copyinstr(fromaddr, toaddr, maxlength, &lencopied)
                   1387:  */
                   1388: ENTRY(copyinstr, R6)
                   1389:        movl    12(ap),r6               # r6 = max length
                   1390:        jlss    8f
                   1391:        movl    4(ap),r1                # r1 = user address
                   1392:        bicl3   $~(NBPG*CLSIZE-1),r1,r2 # r2 = bytes on first page
                   1393:        subl3   r2,$NBPG*CLSIZE,r2
                   1394:        movl    8(ap),r3                # r3 = kernel address
                   1395: 1:
                   1396:        cmpl    r6,r2                   # r2 = min(bytes on page, length left);
                   1397:        jgeq    2f
                   1398:        movl    r6,r2
                   1399: 2:
                   1400:        prober  $3,r2,(r1)              # bytes accessible?
                   1401:        jeql    8f
                   1402:        subl2   r2,r6                   # update bytes left count
                   1403: #ifdef NOSUBSINST
                   1404:        # fake the locc instr. for processors that don't have it
                   1405:        movl    r2,r0
                   1406: 6:
                   1407:        tstb    (r1)+
                   1408:        jeql    5f
                   1409:        sobgtr  r0,6b
                   1410:        jbr     7f
                   1411: 5:
                   1412:        decl    r1
                   1413:        jbr     3f
                   1414: 7:
                   1415: #else
                   1416:        locc    $0,r2,(r1)              # null byte found?
                   1417:        jneq    3f
                   1418: #endif
                   1419:        subl2   r2,r1                   # back up pointer updated by `locc'
                   1420:        movc3   r2,(r1),(r3)            # copy in next piece
                   1421:        movl    $(NBPG*CLSIZE),r2       # check next page
                   1422:        tstl    r6                      # run out of space?
                   1423:        jneq    1b
                   1424:        movl    $ENOENT,r0              # set error code and return
                   1425:        jbr     9f
                   1426: 3:
                   1427:        tstl    16(ap)                  # return length?
                   1428:        beql    4f
                   1429:        subl3   r6,12(ap),r6            # actual len = maxlen - unused pages
                   1430:        subl2   r0,r6                   #       - unused on this page
                   1431:        addl3   $1,r6,*16(ap)           #       + the null byte
                   1432: 4:
                   1433:        subl2   r0,r2                   # r2 = number of bytes to move
                   1434:        subl2   r2,r1                   # back up pointer updated by `locc'
                   1435:        incl    r2                      # copy null byte as well
                   1436:        movc3   r2,(r1),(r3)            # copy in last piece
                   1437:        clrl    r0                      # redundant
                   1438:        ret
                   1439: 8:
                   1440:        movl    $EFAULT,r0
                   1441: 9:
                   1442:        tstl    16(ap)
                   1443:        beql    1f
                   1444:        subl3   r6,12(ap),*16(ap)
                   1445: 1:
                   1446:        ret
                   1447: 
                   1448: /*
                   1449:  * Copy a null terminated string from the kernel
                   1450:  * address space to the user address space.
                   1451:  *
                   1452:  * copyoutstr(fromaddr, toaddr, maxlength, &lencopied)
                   1453:  */
                   1454: ENTRY(copyoutstr, R6)
                   1455:        movl    12(ap),r6               # r6 = max length
                   1456:        jlss    8b
                   1457:        movl    4(ap),r1                # r1 = kernel address
                   1458:        movl    8(ap),r3                # r3 = user address
                   1459:        bicl3   $~(NBPG*CLSIZE-1),r3,r2 # r2 = bytes on first page
                   1460:        subl3   r2,$NBPG*CLSIZE,r2
                   1461: 1:
                   1462:        cmpl    r6,r2                   # r2 = min(bytes on page, length left);
                   1463:        jgeq    2f
                   1464:        movl    r6,r2
                   1465: 2:
                   1466:        probew  $3,r2,(r3)              # bytes accessible?
                   1467:        jeql    8b
                   1468:        subl2   r2,r6                   # update bytes left count
                   1469: #ifdef NOSUBSINST
                   1470:        # fake the locc instr. for processors that don't have it
                   1471:        movl    r2,r0
                   1472: 6:
                   1473:        tstb    (r1)+
                   1474:        jeql    5f
                   1475:        sobgtr  r0,6b
                   1476:        jbr     7f
                   1477: 5:
                   1478:        decl    r1
                   1479:        jbr     3b
                   1480: 7:
                   1481: #else
                   1482:        locc    $0,r2,(r1)              # null byte found?
                   1483:        jneq    3b
                   1484: #endif
                   1485:        subl2   r2,r1                   # back up pointer updated by `locc'
                   1486:        movc3   r2,(r1),(r3)            # copy in next piece
                   1487:        movl    $(NBPG*CLSIZE),r2       # check next page
                   1488:        tstl    r6                      # run out of space?
                   1489:        jneq    1b
                   1490:        movl    $ENOENT,r0              # set error code and return
                   1491:        jbr     9b
                   1492: 
                   1493: /*
                   1494:  * Copy a null terminated string from one point to another in
                   1495:  * the kernel address space.
                   1496:  *
                   1497:  * copystr(fromaddr, toaddr, maxlength, &lencopied)
                   1498:  */
                   1499: ENTRY(copystr, R6)
                   1500:        movl    12(ap),r6               # r6 = max length
                   1501:        jlss    8b
                   1502:        movl    4(ap),r1                # r1 = src address
                   1503:        movl    8(ap),r3                # r3 = dest address
                   1504: 1:
                   1505:        movzwl  $65535,r2               # r2 = bytes in first chunk
                   1506:        cmpl    r6,r2                   # r2 = min(bytes in chunk, length left);
                   1507:        jgeq    2f
                   1508:        movl    r6,r2
                   1509: 2:
                   1510:        subl2   r2,r6                   # update bytes left count
                   1511: #ifdef NOSUBSINST
                   1512:        # fake the locc instr. for processors that don't have it
                   1513:        movl    r2,r0
                   1514: 6:
                   1515:        tstb    (r1)+
                   1516:        jeql    5f
                   1517:        sobgtr  r0,6b
                   1518:        jbr     7f
                   1519: 5:
                   1520:        decl    r1
                   1521:        jbr     3b
                   1522: 7:
                   1523: #else
                   1524:        locc    $0,r2,(r1)              # null byte found?
                   1525:        jneq    3b
                   1526: #endif
                   1527:        subl2   r2,r1                   # back up pointer updated by `locc'
                   1528:        movc3   r2,(r1),(r3)            # copy in next piece
                   1529:        tstl    r6                      # run out of space?
                   1530:        jneq    1b
                   1531:        movl    $ENOENT,r0              # set error code and return
                   1532:        jbr     9b
                   1533: 
                   1534: /* 
                   1535:  * Copy specified amount of data from user space into the kernel
                   1536:  * Copyin(from, to, len)
                   1537:  *     r1 == from (user source address)
                   1538:  *     r3 == to (kernel destination address)
                   1539:  *     r5 == length
                   1540:  */
                   1541:        .align  1
                   1542: JSBENTRY(Copyin, R1|R3|R5)
                   1543:        cmpl    r5,$(NBPG*CLSIZE)       # probing one page or less ?
                   1544:        bgtru   1f                      # no
                   1545:        prober  $3,r5,(r1)              # bytes accessible ?
                   1546:        beql    ersb                    # no
                   1547:        movc3   r5,(r1),(r3)
                   1548: /*     clrl    r0                      # redundant */
                   1549:        rsb
                   1550: 1:
                   1551:        blss    ersb                    # negative length?
                   1552:        pushl   r6                      # r6 = length
                   1553:        movl    r5,r6
                   1554:        bicl3   $~(NBPG*CLSIZE-1),r1,r0 # r0 = bytes on first page
                   1555:        subl3   r0,$(NBPG*CLSIZE),r0
                   1556:        addl2   $(NBPG*CLSIZE),r0       # plus one additional full page
                   1557:        jbr     2f
                   1558: 
                   1559: ciloop:
                   1560:        movc3   r0,(r1),(r3)
                   1561:        movl    $(2*NBPG*CLSIZE),r0     # next amount to move
                   1562: 2:
                   1563:        cmpl    r0,r6
                   1564:        bleq    3f
                   1565:        movl    r6,r0
                   1566: 3:
                   1567:        prober  $3,r0,(r1)              # bytes accessible ?
                   1568:        beql    ersb1                   # no
                   1569:        subl2   r0,r6                   # last move?
                   1570:        bneq    ciloop                  # no
                   1571: 
                   1572:        movc3   r0,(r1),(r3)
                   1573: /*     clrl    r0                      # redundant */
                   1574:        movl    (sp)+,r6                # restore r6
                   1575:        rsb
                   1576: 
                   1577: ersb1:
                   1578:        movl    (sp)+,r6                # restore r6
                   1579: ersb:
                   1580:        movl    $EFAULT,r0
                   1581:        rsb
                   1582: 
                   1583: /* 
                   1584:  * Copy specified amount of data from kernel to the user space
                   1585:  * Copyout(from, to, len)
                   1586:  *     r1 == from (kernel source address)
                   1587:  *     r3 == to (user destination address)
                   1588:  *     r5 == length
                   1589:  */
                   1590:        .align  1
                   1591: JSBENTRY(Copyout, R1|R3|R5)
                   1592:        cmpl    r5,$(NBPG*CLSIZE)       # moving one page or less ?
                   1593:        bgtru   1f                      # no
                   1594:        probew  $3,r5,(r3)              # bytes writeable?
                   1595:        beql    ersb                    # no
                   1596:        movc3   r5,(r1),(r3)
                   1597: /*     clrl    r0                      # redundant */
                   1598:        rsb
                   1599: 1:
                   1600:        blss    ersb                    # negative length?
                   1601:        pushl   r6                      # r6 = length
                   1602:        movl    r5,r6
                   1603:        bicl3   $~(NBPG*CLSIZE-1),r3,r0 # r0 = bytes on first page
                   1604:        subl3   r0,$(NBPG*CLSIZE),r0
                   1605:        addl2   $(NBPG*CLSIZE),r0       # plus one additional full page
                   1606:        jbr     2f
                   1607: 
                   1608: coloop:
                   1609:        movc3   r0,(r1),(r3)
                   1610:        movl    $(2*NBPG*CLSIZE),r0     # next amount to move
                   1611: 2:
                   1612:        cmpl    r0,r6
                   1613:        bleq    3f
                   1614:        movl    r6,r0
                   1615: 3:
                   1616:        probew  $3,r0,(r3)              # bytes writeable?
                   1617:        beql    ersb1                   # no
                   1618:        subl2   r0,r6                   # last move?
                   1619:        bneq    coloop                  # no
                   1620: 
                   1621:        movc3   r0,(r1),(r3)
                   1622: /*     clrl    r0                      # redundant */
                   1623:        movl    (sp)+,r6                # restore r6
                   1624:        rsb
                   1625: 
                   1626: /*
                   1627:  * savectx is like setjmp but saves all registers.
                   1628:  * Called before swapping out the u. area, restored by resume()
                   1629:  * below.
                   1630:  */
                   1631: #define PCLOC 16       /* location of pc in calls frame */
                   1632: #define APLOC 8                /* location of ap,fp in calls frame */
                   1633: 
                   1634: ENTRY(savectx, 0)
                   1635:        movl    4(ap),r0
                   1636:        movq    r6,(r0)+
                   1637:        movq    r8,(r0)+
                   1638:        movq    r10,(r0)+
                   1639:        movq    APLOC(fp),(r0)+ # save ap, fp
                   1640:        addl3   $8,ap,(r0)+     # save sp
                   1641:        movl    PCLOC(fp),(r0)  # save pc
                   1642:        clrl    r0
                   1643:        ret
                   1644: 
                   1645: #ifdef KADB
                   1646: /*
                   1647:  * C library -- reset, setexit
                   1648:  *
                   1649:  *     reset(x)
                   1650:  * will generate a "return" from
                   1651:  * the last call to
                   1652:  *     setexit()
                   1653:  * by restoring r6 - r12, ap, fp
                   1654:  * and doing a return.
                   1655:  * The returned value is x; on the original
                   1656:  * call the returned value is 0.
                   1657:  */
                   1658: ENTRY(setexit, 0)
                   1659:        movab   setsav,r0
                   1660:        movq    r6,(r0)+
                   1661:        movq    r8,(r0)+
                   1662:        movq    r10,(r0)+
                   1663:        movq    8(fp),(r0)+             # ap, fp
                   1664:        movab   4(ap),(r0)+             # sp
                   1665:        movl    16(fp),(r0)             # pc
                   1666:        clrl    r0
                   1667:        ret
                   1668: 
                   1669: ENTRY(reset, 0)
                   1670:        movl    4(ap),r0        # returned value
                   1671:        movab   setsav,r1
                   1672:        movq    (r1)+,r6
                   1673:        movq    (r1)+,r8
                   1674:        movq    (r1)+,r10
                   1675:        movq    (r1)+,r12
                   1676:        movl    (r1)+,sp
                   1677:        jmp     *(r1)
                   1678: 
                   1679:        .data
                   1680:        .align  2
                   1681: setsav:        .space  10*4
                   1682:        .text
                   1683: #endif
                   1684: 
                   1685:        .globl  _whichqs
                   1686:        .globl  _qs
                   1687:        .globl  _cnt
                   1688: 
                   1689:        .globl  _noproc
                   1690:        .comm   _noproc,4
                   1691:        .globl  _runrun
                   1692:        .comm   _runrun,4
                   1693: 
                   1694: /*
                   1695:  * The following primitives use the fancy VAX instructions
                   1696:  * much like VMS does.  _whichqs tells which of the 32 queues _qs
                   1697:  * have processes in them.  Setrq puts processes into queues, Remrq
                   1698:  * removes them from queues.  The running process is on no queue,
                   1699:  * other processes are on a queue related to p->p_pri, divided by 4
                   1700:  * actually to shrink the 0-127 range of priorities into the 32 available
                   1701:  * queues.
                   1702:  */
                   1703: 
                   1704: /*
                   1705:  * Setrq(p), using fancy VAX instructions.
                   1706:  *
                   1707:  * Call should be made at splclock(), and p->p_stat should be SRUN
                   1708:  */
                   1709:        .align  1
                   1710: JSBENTRY(Setrq, R0)
                   1711:        tstl    P_RLINK(r0)             ## firewall: p->p_rlink must be 0
                   1712:        beql    set1                    ##
                   1713:        pushab  set3                    ##
                   1714:        calls   $1,_panic               ##
                   1715: set1:
                   1716:        movzbl  P_PRI(r0),r1            # put on queue which is p->p_pri / 4
                   1717:        ashl    $-2,r1,r1
                   1718:        movaq   _qs[r1],r2
                   1719:        insque  (r0),*4(r2)             # at end of queue
                   1720:        bbss    r1,_whichqs,set2        # mark queue non-empty
                   1721: set2:
                   1722:        rsb
                   1723: 
                   1724: set3:  .asciz  "setrq"
                   1725: 
                   1726: /*
                   1727:  * Remrq(p), using fancy VAX instructions
                   1728:  *
                   1729:  * Call should be made at splclock().
                   1730:  */
                   1731:        .align  1
                   1732: JSBENTRY(Remrq, R0)
                   1733:        movzbl  P_PRI(r0),r1
                   1734:        ashl    $-2,r1,r1
                   1735:        bbsc    r1,_whichqs,rem1
                   1736:        pushab  rem3                    # it wasn't recorded to be on its q
                   1737:        calls   $1,_panic
                   1738: rem1:
                   1739:        remque  (r0),r2
                   1740:        beql    rem2
                   1741:        bbss    r1,_whichqs,rem2
                   1742: rem2:
                   1743:        clrl    P_RLINK(r0)             ## for firewall checking
                   1744:        rsb
                   1745: 
                   1746: rem3:  .asciz  "remrq"
                   1747: 
                   1748: /*
                   1749:  * Masterpaddr is the p->p_addr of the running process on the master
                   1750:  * processor.  When a multiprocessor system, the slave processors will have
                   1751:  * an array of slavepaddr's.
                   1752:  */
                   1753:        .globl  _masterpaddr
                   1754:        .data
                   1755: _masterpaddr:
                   1756:        .long   0
                   1757: 
                   1758:        .text
                   1759: sw0:   .asciz  "swtch"
                   1760: 
                   1761: /*
                   1762:  * When no processes are on the runq, Swtch branches to idle
                   1763:  * to wait for something to come ready.
                   1764:  */
                   1765:        .globl  Idle
                   1766: Idle: idle:
                   1767:        movl    $1,_noproc
                   1768:        mtpr    $0,$IPL                 # must allow interrupts here
                   1769: 1:
                   1770:        tstl    _whichqs                # look for non-empty queue
                   1771:        bneq    sw1
                   1772:        brb     1b
                   1773: 
                   1774: badsw: pushab  sw0
                   1775:        calls   $1,_panic
                   1776:        /*NOTREACHED*/
                   1777: 
                   1778: /*
                   1779:  * Swtch(), using fancy VAX instructions
                   1780:  */
                   1781:        .align  1
                   1782: JSBENTRY(Swtch, 0)
                   1783:        incl    _cnt+V_SWTCH
                   1784: sw1:   ffs     $0,$32,_whichqs,r0      # look for non-empty queue
                   1785:        beql    idle                    # if none, idle
                   1786:        mtpr    $0x18,$IPL              # lock out all so _whichqs==_qs
                   1787:        bbcc    r0,_whichqs,sw1         # proc moved via interrupt
                   1788:        movaq   _qs[r0],r1
                   1789:        remque  *(r1),r2                # r2 = p = highest pri process
                   1790:        bvs     badsw                   # make sure something was there
                   1791:        beql    sw2
                   1792:        insv    $1,r0,$1,_whichqs       # still more procs in this queue
                   1793: sw2:
                   1794:        clrl    _noproc
                   1795:        clrl    _runrun
                   1796: #ifdef notdef
                   1797:        tstl    P_WCHAN(r2)             ## firewalls
                   1798:        bneq    badsw                   ##
                   1799:        cmpb    P_STAT(r2),$SRUN        ##
                   1800:        bneq    badsw                   ##
                   1801: #endif
                   1802:        clrl    P_RLINK(r2)             ##
                   1803:        movl    *P_ADDR(r2),r0
                   1804: #ifdef notdef
                   1805:        cmpl    r0,_masterpaddr         # resume of current proc is easy
                   1806:        beql    res0
                   1807: #endif
                   1808:        movl    r0,_masterpaddr
                   1809:        ashl    $PGSHIFT,r0,r0          # r0 = pcbb(p)
                   1810: /* fall into... */
                   1811: 
                   1812: /*
                   1813:  * Resume(pf)
                   1814:  */
                   1815: JSBENTRY(Resume, R0)
                   1816:        mtpr    $HIGH,$IPL                      # no interrupts, please
                   1817:        movl    _CMAP2,_u+PCB_CMAP2     # yech
                   1818:        svpctx
                   1819:        mtpr    r0,$PCBB
                   1820:        ldpctx
                   1821:        movl    _u+PCB_CMAP2,_CMAP2     # yech
                   1822:        mtpr    $_CADDR2,$TBIS
                   1823: res0:
                   1824:        tstl    _u+PCB_SSWAP
                   1825:        bneq    res1
                   1826:        rei
                   1827: res1:
                   1828:        movl    _u+PCB_SSWAP,r0         # restore alternate saved context
                   1829:        clrl    _u+PCB_SSWAP
                   1830:        movq    (r0)+,r6                        # restore r6, r7
                   1831:        movq    (r0)+,r8                        # restore r8, r9
                   1832:        movq    (r0)+,r10                       # restore r10, r11
                   1833:        movq    (r0)+,r12                       # restore ap, fp
                   1834:        movl    (r0)+,r1                        # saved sp
                   1835:        cmpl    r1,sp                           # must be a pop
                   1836:        bgequ   1f
                   1837:        pushab  2f
                   1838:        calls   $1,_panic
                   1839:        /* NOTREACHED */
                   1840: 1:
                   1841:        movl    r1,sp                           # restore sp
                   1842:        pushl   $PSL_PRVMOD                     # return psl
                   1843:        pushl   (r0)                            # address to return to
                   1844:        rei
                   1845: 
                   1846: 2:     .asciz  "ldctx"
                   1847: 
                   1848: /*
                   1849:  * {fu,su},{byte,word}, all massaged by asm.sed to jsb's
                   1850:  */
                   1851:        .align  1
                   1852: JSBENTRY(Fuword, R0)
                   1853:        prober  $3,$4,(r0)
                   1854:        beql    fserr
                   1855:        movl    (r0),r0
                   1856:        rsb
                   1857: fserr:
                   1858:        mnegl   $1,r0
                   1859:        rsb
                   1860: 
                   1861:        .align  1
                   1862: JSBENTRY(Fubyte, R0)
                   1863:        prober  $3,$1,(r0)
                   1864:        beql    fserr
                   1865:        movzbl  (r0),r0
                   1866:        rsb
                   1867: 
                   1868:        .align  1
                   1869: JSBENTRY(Suword, R0|R1)
                   1870:        probew  $3,$4,(r0)
                   1871:        beql    fserr
                   1872:        movl    r1,(r0)
                   1873:        clrl    r0
                   1874:        rsb
                   1875: 
                   1876:        .align  1
                   1877: JSBENTRY(Subyte, R0|R1)
                   1878:        probew  $3,$1,(r0)
                   1879:        beql    fserr
                   1880:        movb    r1,(r0)
                   1881:        clrl    r0
                   1882:        rsb
                   1883: 
                   1884: /*
                   1885:  * Copy 1 relocation unit (NBPG bytes)
                   1886:  * from user virtual address to physical address
                   1887:  */
                   1888: ENTRY(copyseg, 0)
                   1889:        bisl3   $PG_V|PG_KW,8(ap),_CMAP2
                   1890:        mtpr    $_CADDR2,$TBIS  # invalidate entry for copy 
                   1891:        movc3   $NBPG,*4(ap),_CADDR2
                   1892:        ret
                   1893: 
                   1894: /*
                   1895:  * zero out physical memory
                   1896:  * specified in relocation units (NBPG bytes)
                   1897:  */
                   1898: ENTRY(clearseg, 0)
                   1899:        bisl3   $PG_V|PG_KW,4(ap),_CMAP1
                   1900:        mtpr    $_CADDR1,$TBIS
                   1901:        movc5   $0,(sp),$0,$NBPG,_CADDR1
                   1902:        ret
                   1903: 
                   1904: /*
                   1905:  * Check address.
                   1906:  * Given virtual address, byte count, and rw flag
                   1907:  * returns 0 on no access.
                   1908:  */
                   1909: ENTRY(useracc, 0)
                   1910:        movl    4(ap),r0                # get va
                   1911:        movl    8(ap),r1                # count
                   1912:        tstl    12(ap)                  # test for read access ?
                   1913:        bneq    userar                  # yes
                   1914:        cmpl    $NBPG,r1                        # can we do it in one probe ?
                   1915:        bgeq    uaw2                    # yes
                   1916: uaw1:
                   1917:        probew  $3,$NBPG,(r0)
                   1918:        beql    uaerr                   # no access
                   1919:        addl2   $NBPG,r0
                   1920:        acbl    $NBPG+1,$-NBPG,r1,uaw1
                   1921: uaw2:
                   1922:        probew  $3,r1,(r0)
                   1923:        beql    uaerr
                   1924:        movl    $1,r0
                   1925:        ret
                   1926: 
                   1927: userar:
                   1928:        cmpl    $NBPG,r1
                   1929:        bgeq    uar2
                   1930: uar1:
                   1931:        prober  $3,$NBPG,(r0)
                   1932:        beql    uaerr
                   1933:        addl2   $NBPG,r0
                   1934:        acbl    $NBPG+1,$-NBPG,r1,uar1
                   1935: uar2:
                   1936:        prober  $3,r1,(r0)
                   1937:        beql    uaerr
                   1938:        movl    $1,r0
                   1939:        ret
                   1940: uaerr:
                   1941:        clrl    r0
                   1942:        ret
                   1943: 
                   1944: /*
                   1945:  * kernacc - check for kernel access privileges
                   1946:  *
                   1947:  * We can't use the probe instruction directly because
                   1948:  * it ors together current and previous mode.
                   1949:  */
                   1950:  ENTRY(kernacc, 0)
                   1951:        movl    4(ap),r0        # virtual address
                   1952:        bbcc    $31,r0,kacc1
                   1953:        bbs     $30,r0,kacerr
                   1954:        mfpr    $SBR,r2         # address and length of page table (system)
                   1955:        bbss    $31,r2,0f; 0:
                   1956:        mfpr    $SLR,r3
                   1957:        brb     kacc2
                   1958: kacc1:
                   1959:        bbsc    $30,r0,kacc3
                   1960:        mfpr    $P0BR,r2        # user P0
                   1961:        mfpr    $P0LR,r3
                   1962:        brb     kacc2
                   1963: kacc3:
                   1964:        mfpr    $P1BR,r2        # user P1 (stack)
                   1965:        mfpr    $P1LR,r3
                   1966: kacc2:
                   1967:        addl3   8(ap),r0,r1     # ending virtual address
                   1968:        addl2   $NBPG-1,r1
                   1969:        ashl    $-PGSHIFT,r0,r0
                   1970:        ashl    $-PGSHIFT,r1,r1
                   1971:        bbs     $31,4(ap),kacc6
                   1972:        bbc     $30,4(ap),kacc6
                   1973:        cmpl    r0,r3           # user stack
                   1974:        blss    kacerr          # address too low
                   1975:        brb     kacc4
                   1976: kacc6:
                   1977:        cmpl    r1,r3           # compare last page to P0LR or SLR
                   1978:        bgtr    kacerr          # address too high
                   1979: kacc4: 
                   1980:        movl    (r2)[r0],r3
                   1981:        bbc     $31,4(ap),kacc4a
                   1982:        bbc     $31,r3,kacerr   # valid bit is off
                   1983: kacc4a:
                   1984:        cmpzv   $27,$4,r3,$1    # check protection code
                   1985:        bleq    kacerr          # no access allowed
                   1986:        tstb    12(ap)
                   1987:        bneq    kacc5           # only check read access
                   1988:        cmpzv   $27,$2,r3,$3    # check low 2 bits of prot code
                   1989:        beql    kacerr          # no write access
                   1990: kacc5:
                   1991:        aoblss  r1,r0,kacc4     # next page
                   1992:        movl    $1,r0           # no errors
                   1993:        ret
                   1994: kacerr:
                   1995:        clrl    r0              # error
                   1996:        ret
                   1997: /*
                   1998:  * Extracted and unrolled most common case of pagein (hopefully):
                   1999:  *     resident and not on free list (reclaim of page is purely
                   2000:  *     for the purpose of simulating a reference bit)
                   2001:  *
                   2002:  * Built in constants:
                   2003:  *     CLSIZE of 2, any bit fields in pte's
                   2004:  */
                   2005:        .text
                   2006:        .globl  Fastreclaim
                   2007: Fastreclaim:
                   2008:        PUSHR
                   2009: #ifdef GPROF
                   2010:        movl    fp,-(sp)
                   2011:        movab   12(sp),fp
                   2012:        jsb     mcount
                   2013:        movl    (sp)+,fp
                   2014: #endif GPROF
                   2015:        extzv   $9,$23,28(sp),r3        # virtual address
                   2016:        bicl2   $1,r3                   # v = clbase(btop(virtaddr)); 
                   2017:        movl    _u+U_PROCP,r5           # p = u.u_procp 
                   2018:                                        # from vtopte(p, v) ...
                   2019:        movl    $1,r2                   # type = CTEXT;
                   2020:        cmpl    r3,P_TSIZE(r5)
                   2021:        jlssu   1f                      # if (isatsv(p, v)) {
                   2022:        addl3   P_TSIZE(r5),P_DSIZE(r5),r0
                   2023:        cmpl    r3,r0
                   2024:        jgequ   2f
                   2025:        clrl    r2                      #       type = !CTEXT;
                   2026: 1:
                   2027:        ashl    $2,r3,r4
                   2028:        addl2   P_P0BR(r5),r4           #       tptopte(p, vtotp(p, v));
                   2029:        jbr     3f
                   2030: 2:
                   2031:        cvtwl   P_SZPT(r5),r4           # } else (isassv(p, v)) {
                   2032:        ashl    $7,r4,r4
                   2033:        subl2   $0x400000,r4
                   2034:        addl2   r3,r4
                   2035:        ashl    $2,r4,r4
                   2036:        addl2   P_P0BR(r5),r4           #       sptopte(p, vtosp(p, v));
                   2037:        clrl    r2                      #       type = !CTEXT;
                   2038: 3:                                     # }
                   2039:        bitb    $0x82,3(r4)
                   2040:        beql    2f                      # if (pte->pg_v || pte->pg_fod)
                   2041:        POPR; rsb                       #       let pagein handle it
                   2042: 2:
                   2043:        bicl3   $0xffe00000,(r4),r0
                   2044:        jneq    2f                      # if (pte->pg_pfnum == 0)
                   2045:        POPR; rsb                       #       let pagein handle it 
                   2046: 2:
                   2047:        subl2   _firstfree,r0
                   2048:        ashl    $-1,r0,r0       
                   2049:        incl    r0                      # pgtocm(pte->pg_pfnum) 
                   2050:        mull2   $SZ_CMAP,r0
                   2051:        addl2   _cmap,r0                # &cmap[pgtocm(pte->pg_pfnum)] 
                   2052:        tstl    r2
                   2053:        jeql    2f                      # if (type == CTEXT &&
                   2054:        jbc     $C_INTRANS,(r0),2f      #     c_intrans)
                   2055:        POPR; rsb                       #       let pagein handle it
                   2056: 2:
                   2057:        jbc     $C_FREE,(r0),2f         # if (c_free)
                   2058:        POPR; rsb                       #       let pagein handle it 
                   2059: 2:
                   2060:        bisb2   $0x80,3(r4)             # pte->pg_v = 1;
                   2061:        jbc     $26,4(r4),2f            # if (anycl(pte, pg_m) 
                   2062:        bisb2   $0x04,3(r4)             #       pte->pg_m = 1;
                   2063: 2:
                   2064:        bicw3   $0x7f,2(r4),r0
                   2065:        bicw3   $0xff80,6(r4),r1
                   2066:        bisw3   r0,r1,6(r4)             # distcl(pte);
                   2067:        ashl    $PGSHIFT,r3,r0
                   2068:        mtpr    r0,$TBIS
                   2069:        addl2   $NBPG,r0
                   2070:        mtpr    r0,$TBIS                # tbiscl(v); 
                   2071:        tstl    r2
                   2072:        jeql    2f                      # if (type == CTEXT) 
                   2073:        movl    P_TEXTP(r5),r0
                   2074:        movl    X_CADDR(r0),r5          # for (p = p->p_textp->x_caddr; p; ) {
                   2075:        jeql    2f
                   2076:        ashl    $2,r3,r3
                   2077: 3:
                   2078:        addl3   P_P0BR(r5),r3,r0        #       tpte = tptopte(p, tp);
                   2079:        bisb2   $1,P_FLAG+3(r5)         #       p->p_flag |= SPTECHG;
                   2080:        movl    (r4),(r0)+              #       for (i = 0; i < CLSIZE; i++)
                   2081:        movl    4(r4),(r0)              #               tpte[i] = pte[i];
                   2082:        movl    P_XLINK(r5),r5          #       p = p->p_xlink;
                   2083:        jneq    3b                      # }
                   2084: 2:                                     # collect a few statistics...
                   2085:        incl    _u+U_RU+RU_MINFLT       # u.u_ru.ru_minflt++;
                   2086:        moval   _cnt,r0
                   2087:        incl    V_FAULTS(r0)            # cnt.v_faults++; 
                   2088:        incl    V_PGREC(r0)             # cnt.v_pgrec++;
                   2089:        incl    V_FASTPGREC(r0)         # cnt.v_fastpgrec++;
                   2090:        incl    V_TRAP(r0)              # cnt.v_trap++;
                   2091:        POPR
                   2092:        addl2   $8,sp                   # pop pc, code
                   2093:        mtpr    $HIGH,$IPL              ## dont go to a higher IPL (GROT)
                   2094:        rei
                   2095:        .globl  _Xkdbintr0
                   2096:        .align  2
                   2097: _Xkdbintr0:
                   2098:        pushr   $0x3f
                   2099:        incl    _fltintrcnt+(4*0)
                   2100:        pushl   $0
                   2101:        calls   $1,_kdbintr
                   2102:        popr    $0x3f
                   2103:        incl    _cnt+V_INTR
                   2104:        rei
                   2105: 
                   2106:        .globl  _Xrkintr0
                   2107:        .align  2
                   2108: _Xrkintr0:
                   2109:        pushr   $0x3f
                   2110:        incl    _fltintrcnt+(4*1)
                   2111:        pushl   $0
                   2112:        calls   $1,_rkintr
                   2113:        popr    $0x3f
                   2114:        incl    _cnt+V_INTR
                   2115:        rei
                   2116: 
                   2117:        .globl  _Xtmintr0
                   2118:        .align  2
                   2119: _Xtmintr0:
                   2120:        pushr   $0x3f
                   2121:        incl    _fltintrcnt+(4*2)
                   2122:        pushl   $0
                   2123:        calls   $1,_tmintr
                   2124:        popr    $0x3f
                   2125:        incl    _cnt+V_INTR
                   2126:        rei
                   2127: 
                   2128:        .globl  _Xutintr0
                   2129:        .align  2
                   2130: _Xutintr0:
                   2131:        pushr   $0x3f
                   2132:        incl    _fltintrcnt+(4*3)
                   2133:        pushl   $0
                   2134:        calls   $1,_utintr
                   2135:        popr    $0x3f
                   2136:        incl    _cnt+V_INTR
                   2137:        rei
                   2138: 
                   2139:        .globl  _Xtmscpintr0
                   2140:        .align  2
                   2141: _Xtmscpintr0:
                   2142:        pushr   $0x3f
                   2143:        incl    _fltintrcnt+(4*4)
                   2144:        pushl   $0
                   2145:        calls   $1,_tmscpintr
                   2146:        popr    $0x3f
                   2147:        incl    _cnt+V_INTR
                   2148:        rei
                   2149: 
                   2150:        .globl  _Xupintr0
                   2151:        .align  2
                   2152: _Xupintr0:
                   2153:        pushr   $0x3f
                   2154:        incl    _fltintrcnt+(4*5)
                   2155:        pushl   $0
                   2156:        calls   $1,_upintr
                   2157:        popr    $0x3f
                   2158:        incl    _cnt+V_INTR
                   2159:        rei
                   2160: 
                   2161:        .globl  _Xudaintr0
                   2162:        .align  2
                   2163: _Xudaintr0:
                   2164:        pushr   $0x3f
                   2165:        incl    _fltintrcnt+(4*6)
                   2166:        pushl   $0
                   2167:        calls   $1,_udaintr
                   2168:        popr    $0x3f
                   2169:        incl    _cnt+V_INTR
                   2170:        rei
                   2171: 
                   2172:        .globl  _Xidcintr0
                   2173:        .align  2
                   2174: _Xidcintr0:
                   2175:        pushr   $0x3f
                   2176:        incl    _fltintrcnt+(4*7)
                   2177:        pushl   $0
                   2178:        calls   $1,_idcintr
                   2179:        popr    $0x3f
                   2180:        incl    _cnt+V_INTR
                   2181:        rei
                   2182: 
                   2183:        .globl  _Xrlintr0
                   2184:        .align  2
                   2185: _Xrlintr0:
                   2186:        pushr   $0x3f
                   2187:        incl    _fltintrcnt+(4*8)
                   2188:        pushl   $0
                   2189:        calls   $1,_rlintr
                   2190:        popr    $0x3f
                   2191:        incl    _cnt+V_INTR
                   2192:        rei
                   2193: 
                   2194:        .globl  _Xdhrint0
                   2195:        .align  2
                   2196: _Xdhrint0:
                   2197:        pushr   $0x3f
                   2198:        incl    _fltintrcnt+(4*9)
                   2199:        pushl   $0
                   2200:        calls   $1,_dhrint
                   2201:        popr    $0x3f
                   2202:        incl    _cnt+V_INTR
                   2203:        rei
                   2204: 
                   2205:        .globl  _Xdhxint0
                   2206:        .align  2
                   2207: _Xdhxint0:
                   2208:        pushr   $0x3f
                   2209:        incl    _fltintrcnt+(4*10)
                   2210:        pushl   $0
                   2211:        calls   $1,_dhxint
                   2212:        popr    $0x3f
                   2213:        incl    _cnt+V_INTR
                   2214:        rei
                   2215: 
                   2216:        .globl  _Xdmintr0
                   2217:        .align  2
                   2218: _Xdmintr0:
                   2219:        pushr   $0x3f
                   2220:        incl    _fltintrcnt+(4*11)
                   2221:        pushl   $0
                   2222:        calls   $1,_dmintr
                   2223:        popr    $0x3f
                   2224:        incl    _cnt+V_INTR
                   2225:        rei
                   2226: 
                   2227:        .globl  _Xdhrint1
                   2228:        .align  2
                   2229: _Xdhrint1:
                   2230:        pushr   $0x3f
                   2231:        incl    _fltintrcnt+(4*12)
                   2232:        pushl   $1
                   2233:        calls   $1,_dhrint
                   2234:        popr    $0x3f
                   2235:        incl    _cnt+V_INTR
                   2236:        rei
                   2237: 
                   2238:        .globl  _Xdhxint1
                   2239:        .align  2
                   2240: _Xdhxint1:
                   2241:        pushr   $0x3f
                   2242:        incl    _fltintrcnt+(4*13)
                   2243:        pushl   $1
                   2244:        calls   $1,_dhxint
                   2245:        popr    $0x3f
                   2246:        incl    _cnt+V_INTR
                   2247:        rei
                   2248: 
                   2249:        .globl  _Xdzrint0
                   2250:        .align  2
                   2251: _Xdzrint0:
                   2252:        pushr   $0x3f
                   2253:        incl    _fltintrcnt+(4*14)
                   2254:        pushl   $0
                   2255:        calls   $1,_dzrint
                   2256:        popr    $0x3f
                   2257:        incl    _cnt+V_INTR
                   2258:        rei
                   2259: 
                   2260:        .globl  _Xdzxint0
                   2261:        .align  2
                   2262: _Xdzxint0:
                   2263:        pushr   $0x3f
                   2264:        incl    _fltintrcnt+(4*15)
                   2265:        movl    $0,r0
                   2266:        jmp     dzdma
                   2267: 
                   2268:        .globl  _Xdzrint1
                   2269:        .align  2
                   2270: _Xdzrint1:
                   2271:        pushr   $0x3f
                   2272:        incl    _fltintrcnt+(4*16)
                   2273:        pushl   $1
                   2274:        calls   $1,_dzrint
                   2275:        popr    $0x3f
                   2276:        incl    _cnt+V_INTR
                   2277:        rei
                   2278: 
                   2279:        .globl  _Xdzxint1
                   2280:        .align  2
                   2281: _Xdzxint1:
                   2282:        pushr   $0x3f
                   2283:        incl    _fltintrcnt+(4*17)
                   2284:        movl    $1,r0
                   2285:        jmp     dzdma
                   2286: 
                   2287:        .globl  _Xdzrint2
                   2288:        .align  2
                   2289: _Xdzrint2:
                   2290:        pushr   $0x3f
                   2291:        incl    _fltintrcnt+(4*18)
                   2292:        pushl   $2
                   2293:        calls   $1,_dzrint
                   2294:        popr    $0x3f
                   2295:        incl    _cnt+V_INTR
                   2296:        rei
                   2297: 
                   2298:        .globl  _Xdzxint2
                   2299:        .align  2
                   2300: _Xdzxint2:
                   2301:        pushr   $0x3f
                   2302:        incl    _fltintrcnt+(4*19)
                   2303:        movl    $2,r0
                   2304:        jmp     dzdma
                   2305: 
                   2306:        .globl  _Xdzrint3
                   2307:        .align  2
                   2308: _Xdzrint3:
                   2309:        pushr   $0x3f
                   2310:        incl    _fltintrcnt+(4*20)
                   2311:        pushl   $3
                   2312:        calls   $1,_dzrint
                   2313:        popr    $0x3f
                   2314:        incl    _cnt+V_INTR
                   2315:        rei
                   2316: 
                   2317:        .globl  _Xdzxint3
                   2318:        .align  2
                   2319: _Xdzxint3:
                   2320:        pushr   $0x3f
                   2321:        incl    _fltintrcnt+(4*21)
                   2322:        movl    $3,r0
                   2323:        jmp     dzdma
                   2324: 
                   2325:        .globl  _Xdzrint4
                   2326:        .align  2
                   2327: _Xdzrint4:
                   2328:        pushr   $0x3f
                   2329:        incl    _fltintrcnt+(4*22)
                   2330:        pushl   $4
                   2331:        calls   $1,_dzrint
                   2332:        popr    $0x3f
                   2333:        incl    _cnt+V_INTR
                   2334:        rei
                   2335: 
                   2336:        .globl  _Xdzxint4
                   2337:        .align  2
                   2338: _Xdzxint4:
                   2339:        pushr   $0x3f
                   2340:        incl    _fltintrcnt+(4*23)
                   2341:        movl    $4,r0
                   2342:        jmp     dzdma
                   2343: 
                   2344:        .globl  _Xdzrint5
                   2345:        .align  2
                   2346: _Xdzrint5:
                   2347:        pushr   $0x3f
                   2348:        incl    _fltintrcnt+(4*24)
                   2349:        pushl   $5
                   2350:        calls   $1,_dzrint
                   2351:        popr    $0x3f
                   2352:        incl    _cnt+V_INTR
                   2353:        rei
                   2354: 
                   2355:        .globl  _Xdzxint5
                   2356:        .align  2
                   2357: _Xdzxint5:
                   2358:        pushr   $0x3f
                   2359:        incl    _fltintrcnt+(4*25)
                   2360:        movl    $5,r0
                   2361:        jmp     dzdma
                   2362: 
                   2363:        .globl  _Xdzrint6
                   2364:        .align  2
                   2365: _Xdzrint6:
                   2366:        pushr   $0x3f
                   2367:        incl    _fltintrcnt+(4*26)
                   2368:        pushl   $6
                   2369:        calls   $1,_dzrint
                   2370:        popr    $0x3f
                   2371:        incl    _cnt+V_INTR
                   2372:        rei
                   2373: 
                   2374:        .globl  _Xdzxint6
                   2375:        .align  2
                   2376: _Xdzxint6:
                   2377:        pushr   $0x3f
                   2378:        incl    _fltintrcnt+(4*27)
                   2379:        movl    $6,r0
                   2380:        jmp     dzdma
                   2381: 
                   2382:        .globl  _Xdzrint7
                   2383:        .align  2
                   2384: _Xdzrint7:
                   2385:        pushr   $0x3f
                   2386:        incl    _fltintrcnt+(4*28)
                   2387:        pushl   $7
                   2388:        calls   $1,_dzrint
                   2389:        popr    $0x3f
                   2390:        incl    _cnt+V_INTR
                   2391:        rei
                   2392: 
                   2393:        .globl  _Xdzxint7
                   2394:        .align  2
                   2395: _Xdzxint7:
                   2396:        pushr   $0x3f
                   2397:        incl    _fltintrcnt+(4*29)
                   2398:        movl    $7,r0
                   2399:        jmp     dzdma
                   2400: 
                   2401:        .globl  _Xtsintr0
                   2402:        .align  2
                   2403: _Xtsintr0:
                   2404:        pushr   $0x3f
                   2405:        incl    _fltintrcnt+(4*30)
                   2406:        pushl   $0
                   2407:        calls   $1,_tsintr
                   2408:        popr    $0x3f
                   2409:        incl    _cnt+V_INTR
                   2410:        rei
                   2411: 
                   2412:        .globl  _Xdmfsrint0
                   2413:        .align  2
                   2414: _Xdmfsrint0:
                   2415:        pushr   $0x3f
                   2416:        incl    _fltintrcnt+(4*31)
                   2417:        pushl   $0
                   2418:        calls   $1,_dmfsrint
                   2419:        popr    $0x3f
                   2420:        incl    _cnt+V_INTR
                   2421:        rei
                   2422: 
                   2423:        .globl  _Xdmfsxint0
                   2424:        .align  2
                   2425: _Xdmfsxint0:
                   2426:        pushr   $0x3f
                   2427:        incl    _fltintrcnt+(4*32)
                   2428:        pushl   $0
                   2429:        calls   $1,_dmfsxint
                   2430:        popr    $0x3f
                   2431:        incl    _cnt+V_INTR
                   2432:        rei
                   2433: 
                   2434:        .globl  _Xdmfdaint0
                   2435:        .align  2
                   2436: _Xdmfdaint0:
                   2437:        pushr   $0x3f
                   2438:        incl    _fltintrcnt+(4*33)
                   2439:        pushl   $0
                   2440:        calls   $1,_dmfdaint
                   2441:        popr    $0x3f
                   2442:        incl    _cnt+V_INTR
                   2443:        rei
                   2444: 
                   2445:        .globl  _Xdmfdbint0
                   2446:        .align  2
                   2447: _Xdmfdbint0:
                   2448:        pushr   $0x3f
                   2449:        incl    _fltintrcnt+(4*34)
                   2450:        pushl   $0
                   2451:        calls   $1,_dmfdbint
                   2452:        popr    $0x3f
                   2453:        incl    _cnt+V_INTR
                   2454:        rei
                   2455: 
                   2456:        .globl  _Xdmfrint0
                   2457:        .align  2
                   2458: _Xdmfrint0:
                   2459:        pushr   $0x3f
                   2460:        incl    _fltintrcnt+(4*35)
                   2461:        pushl   $0
                   2462:        calls   $1,_dmfrint
                   2463:        popr    $0x3f
                   2464:        incl    _cnt+V_INTR
                   2465:        rei
                   2466: 
                   2467:        .globl  _Xdmfxint0
                   2468:        .align  2
                   2469: _Xdmfxint0:
                   2470:        pushr   $0x3f
                   2471:        incl    _fltintrcnt+(4*36)
                   2472:        pushl   $0
                   2473:        calls   $1,_dmfxint
                   2474:        popr    $0x3f
                   2475:        incl    _cnt+V_INTR
                   2476:        rei
                   2477: 
                   2478:        .globl  _Xdmflint0
                   2479:        .align  2
                   2480: _Xdmflint0:
                   2481:        pushr   $0x3f
                   2482:        incl    _fltintrcnt+(4*37)
                   2483:        pushl   $0
                   2484:        calls   $1,_dmflint
                   2485:        popr    $0x3f
                   2486:        incl    _cnt+V_INTR
                   2487:        rei
                   2488: 
                   2489:        .globl  _Xdmzrinta0
                   2490:        .align  2
                   2491: _Xdmzrinta0:
                   2492:        pushr   $0x3f
                   2493:        incl    _fltintrcnt+(4*38)
                   2494:        pushl   $0
                   2495:        calls   $1,_dmzrinta
                   2496:        popr    $0x3f
                   2497:        incl    _cnt+V_INTR
                   2498:        rei
                   2499: 
                   2500:        .globl  _Xdmzxinta0
                   2501:        .align  2
                   2502: _Xdmzxinta0:
                   2503:        pushr   $0x3f
                   2504:        incl    _fltintrcnt+(4*39)
                   2505:        pushl   $0
                   2506:        calls   $1,_dmzxinta
                   2507:        popr    $0x3f
                   2508:        incl    _cnt+V_INTR
                   2509:        rei
                   2510: 
                   2511:        .globl  _Xdmzrintb0
                   2512:        .align  2
                   2513: _Xdmzrintb0:
                   2514:        pushr   $0x3f
                   2515:        incl    _fltintrcnt+(4*40)
                   2516:        pushl   $0
                   2517:        calls   $1,_dmzrintb
                   2518:        popr    $0x3f
                   2519:        incl    _cnt+V_INTR
                   2520:        rei
                   2521: 
                   2522:        .globl  _Xdmzxintb0
                   2523:        .align  2
                   2524: _Xdmzxintb0:
                   2525:        pushr   $0x3f
                   2526:        incl    _fltintrcnt+(4*41)
                   2527:        pushl   $0
                   2528:        calls   $1,_dmzxintb
                   2529:        popr    $0x3f
                   2530:        incl    _cnt+V_INTR
                   2531:        rei
                   2532: 
                   2533:        .globl  _Xdmzrintc0
                   2534:        .align  2
                   2535: _Xdmzrintc0:
                   2536:        pushr   $0x3f
                   2537:        incl    _fltintrcnt+(4*42)
                   2538:        pushl   $0
                   2539:        calls   $1,_dmzrintc
                   2540:        popr    $0x3f
                   2541:        incl    _cnt+V_INTR
                   2542:        rei
                   2543: 
                   2544:        .globl  _Xdmzxintc0
                   2545:        .align  2
                   2546: _Xdmzxintc0:
                   2547:        pushr   $0x3f
                   2548:        incl    _fltintrcnt+(4*43)
                   2549:        pushl   $0
                   2550:        calls   $1,_dmzxintc
                   2551:        popr    $0x3f
                   2552:        incl    _cnt+V_INTR
                   2553:        rei
                   2554: 
                   2555:        .globl  _Xdhurint0
                   2556:        .align  2
                   2557: _Xdhurint0:
                   2558:        pushr   $0x3f
                   2559:        incl    _fltintrcnt+(4*44)
                   2560:        pushl   $0
                   2561:        calls   $1,_dhurint
                   2562:        popr    $0x3f
                   2563:        incl    _cnt+V_INTR
                   2564:        rei
                   2565: 
                   2566:        .globl  _Xdhuxint0
                   2567:        .align  2
                   2568: _Xdhuxint0:
                   2569:        pushr   $0x3f
                   2570:        incl    _fltintrcnt+(4*45)
                   2571:        pushl   $0
                   2572:        calls   $1,_dhuxint
                   2573:        popr    $0x3f
                   2574:        incl    _cnt+V_INTR
                   2575:        rei
                   2576: 
                   2577:        .globl  _Xlpintr0
                   2578:        .align  2
                   2579: _Xlpintr0:
                   2580:        pushr   $0x3f
                   2581:        incl    _fltintrcnt+(4*46)
                   2582:        pushl   $0
                   2583:        calls   $1,_lpintr
                   2584:        popr    $0x3f
                   2585:        incl    _cnt+V_INTR
                   2586:        rei
                   2587: 
                   2588:        .globl  _Xqvkint0
                   2589:        .align  2
                   2590: _Xqvkint0:
                   2591:        pushr   $0x3f
                   2592:        incl    _fltintrcnt+(4*47)
                   2593:        pushl   $0
                   2594:        calls   $1,_qvkint
                   2595:        popr    $0x3f
                   2596:        incl    _cnt+V_INTR
                   2597:        rei
                   2598: 
                   2599:        .globl  _Xqvvint0
                   2600:        .align  2
                   2601: _Xqvvint0:
                   2602:        pushr   $0x3f
                   2603:        incl    _fltintrcnt+(4*48)
                   2604:        pushl   $0
                   2605:        calls   $1,_qvvint
                   2606:        popr    $0x3f
                   2607:        incl    _cnt+V_INTR
                   2608:        rei
                   2609: 
                   2610:        .globl  _Xqddint0
                   2611:        .align  2
                   2612: _Xqddint0:
                   2613:        pushr   $0x3f
                   2614:        incl    _fltintrcnt+(4*49)
                   2615:        pushl   $0
                   2616:        calls   $1,_qddint
                   2617:        popr    $0x3f
                   2618:        incl    _cnt+V_INTR
                   2619:        rei
                   2620: 
                   2621:        .globl  _Xqdaint0
                   2622:        .align  2
                   2623: _Xqdaint0:
                   2624:        pushr   $0x3f
                   2625:        incl    _fltintrcnt+(4*50)
                   2626:        pushl   $0
                   2627:        calls   $1,_qdaint
                   2628:        popr    $0x3f
                   2629:        incl    _cnt+V_INTR
                   2630:        rei
                   2631: 
                   2632:        .globl  _Xqdiint0
                   2633:        .align  2
                   2634: _Xqdiint0:
                   2635:        pushr   $0x3f
                   2636:        incl    _fltintrcnt+(4*51)
                   2637:        pushl   $0
                   2638:        calls   $1,_qdiint
                   2639:        popr    $0x3f
                   2640:        incl    _cnt+V_INTR
                   2641:        rei
                   2642: 
                   2643:        .globl  _Xecrint0
                   2644:        .align  2
                   2645: _Xecrint0:
                   2646:        pushr   $0x3f
                   2647:        incl    _fltintrcnt+(4*52)
                   2648:        pushl   $0
                   2649:        calls   $1,_ecrint
                   2650:        popr    $0x3f
                   2651:        incl    _cnt+V_INTR
                   2652:        rei
                   2653: 
                   2654:        .globl  _Xeccollide0
                   2655:        .align  2
                   2656: _Xeccollide0:
                   2657:        pushr   $0x3f
                   2658:        incl    _fltintrcnt+(4*53)
                   2659:        pushl   $0
                   2660:        calls   $1,_eccollide
                   2661:        popr    $0x3f
                   2662:        incl    _cnt+V_INTR
                   2663:        rei
                   2664: 
                   2665:        .globl  _Xecxint0
                   2666:        .align  2
                   2667: _Xecxint0:
                   2668:        pushr   $0x3f
                   2669:        incl    _fltintrcnt+(4*54)
                   2670:        pushl   $0
                   2671:        calls   $1,_ecxint
                   2672:        popr    $0x3f
                   2673:        incl    _cnt+V_INTR
                   2674:        rei
                   2675: 
                   2676:        .globl  _Xdeintr0
                   2677:        .align  2
                   2678: _Xdeintr0:
                   2679:        pushr   $0x3f
                   2680:        incl    _fltintrcnt+(4*55)
                   2681:        pushl   $0
                   2682:        calls   $1,_deintr
                   2683:        popr    $0x3f
                   2684:        incl    _cnt+V_INTR
                   2685:        rei
                   2686: 
                   2687:        .globl  _Xilrint0
                   2688:        .align  2
                   2689: _Xilrint0:
                   2690:        pushr   $0x3f
                   2691:        incl    _fltintrcnt+(4*56)
                   2692:        pushl   $0
                   2693:        calls   $1,_ilrint
                   2694:        popr    $0x3f
                   2695:        incl    _cnt+V_INTR
                   2696:        rei
                   2697: 
                   2698:        .globl  _Xilcint0
                   2699:        .align  2
                   2700: _Xilcint0:
                   2701:        pushr   $0x3f
                   2702:        incl    _fltintrcnt+(4*57)
                   2703:        pushl   $0
                   2704:        calls   $1,_ilcint
                   2705:        popr    $0x3f
                   2706:        incl    _cnt+V_INTR
                   2707:        rei
                   2708: 
                   2709:        .globl  _Xexcdint0
                   2710:        .align  2
                   2711: _Xexcdint0:
                   2712:        pushr   $0x3f
                   2713:        incl    _fltintrcnt+(4*58)
                   2714:        pushl   $0
                   2715:        calls   $1,_excdint
                   2716:        popr    $0x3f
                   2717:        incl    _cnt+V_INTR
                   2718:        rei
                   2719: 
                   2720:        .globl  _Xqeintr0
                   2721:        .align  2
                   2722: _Xqeintr0:
                   2723:        pushr   $0x3f
                   2724:        incl    _fltintrcnt+(4*59)
                   2725:        pushl   $0
                   2726:        calls   $1,_qeintr
                   2727:        popr    $0x3f
                   2728:        incl    _cnt+V_INTR
                   2729:        rei
                   2730: 
                   2731: 
                   2732:        .globl  _intrnames
                   2733: 
                   2734:        .globl  _eintrnames
                   2735:        .data
                   2736: _intrnames:
                   2737:        .asciz  "clock"
                   2738:        .asciz  "cnr"
                   2739:        .asciz  "cnx"
                   2740:        .asciz  "tur"
                   2741:        .asciz  "tux"
                   2742:        .asciz  "mba0"
                   2743:        .asciz  "mba1"
                   2744:        .asciz  "mba2"
                   2745:        .asciz  "mba3"
                   2746:        .asciz  "uba0"
                   2747:        .asciz  "uba1"
                   2748:        .asciz  "uba2"
                   2749:        .asciz  "uba3"
                   2750:        .asciz  "kdb0"
                   2751:        .asciz  "rk0"
                   2752:        .asciz  "tm0"
                   2753:        .asciz  "ut0"
                   2754:        .asciz  "tmscp0"
                   2755:        .asciz  "up0"
                   2756:        .asciz  "uda0"
                   2757:        .asciz  "idc0"
                   2758:        .asciz  "rl0"
                   2759:        .asciz  "dhr0"
                   2760:        .asciz  "dhx0"
                   2761:        .asciz  "dm0"
                   2762:        .asciz  "dhr1"
                   2763:        .asciz  "dhx1"
                   2764:        .asciz  "dzr0"
                   2765:        .asciz  "dzx0"
                   2766:        .asciz  "dzr1"
                   2767:        .asciz  "dzx1"
                   2768:        .asciz  "dzr2"
                   2769:        .asciz  "dzx2"
                   2770:        .asciz  "dzr3"
                   2771:        .asciz  "dzx3"
                   2772:        .asciz  "dzr4"
                   2773:        .asciz  "dzx4"
                   2774:        .asciz  "dzr5"
                   2775:        .asciz  "dzx5"
                   2776:        .asciz  "dzr6"
                   2777:        .asciz  "dzx6"
                   2778:        .asciz  "dzr7"
                   2779:        .asciz  "dzx7"
                   2780:        .asciz  "ts0"
                   2781:        .asciz  "dmfsr0"
                   2782:        .asciz  "dmfsx0"
                   2783:        .asciz  "dmfda0"
                   2784:        .asciz  "dmfdb0"
                   2785:        .asciz  "dmfr0"
                   2786:        .asciz  "dmfx0"
                   2787:        .asciz  "dmfl0"
                   2788:        .asciz  "dmzra0"
                   2789:        .asciz  "dmzxa0"
                   2790:        .asciz  "dmzrb0"
                   2791:        .asciz  "dmzxb0"
                   2792:        .asciz  "dmzrc0"
                   2793:        .asciz  "dmzxc0"
                   2794:        .asciz  "dhur0"
                   2795:        .asciz  "dhux0"
                   2796:        .asciz  "lp0"
                   2797:        .asciz  "qvk0"
                   2798:        .asciz  "qvv0"
                   2799:        .asciz  "qdd0"
                   2800:        .asciz  "qda0"
                   2801:        .asciz  "qdi0"
                   2802:        .asciz  "ecr0"
                   2803:        .asciz  "eccollide0"
                   2804:        .asciz  "ecx0"
                   2805:        .asciz  "de0"
                   2806:        .asciz  "ilr0"
                   2807:        .asciz  "ilc0"
                   2808:        .asciz  "excd0"
                   2809:        .asciz  "qe0"
                   2810: _eintrnames:
                   2811: 
                   2812:        .globl  _intrcnt
                   2813: 
                   2814:        .globl  _eintrcnt
                   2815:        .align 2
                   2816: _intrcnt:
                   2817:        .space  4 * 13
                   2818: _fltintrcnt:
                   2819:        .space  4 * 60
                   2820: _eintrcnt:
                   2821: 
                   2822:        .text

unix.superglobalmegacorp.com

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