Annotation of researchv10dc/sys/md/mchkmflow.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Routines that deal closely with VAX-specific traps:
        !             3:  * machine checks, memory errors, and the like
        !             4:  */
        !             5: #include "sys/param.h"
        !             6: #include "sys/systm.h"
        !             7: #include "sys/user.h"
        !             8: #include "sys/mtpr.h"
        !             9: #include "sys/psl.h"
        !            10: #include "sys/qbio.h"
        !            11: 
        !            12: extern char *iospace;
        !            13: 
        !            14: /*
        !            15:  * interesting bits in mser
        !            16:  */
        !            17: 
        !            18: #define        DMAQPE  020
        !            19: #define        CPUQPE  040
        !            20: #define        CPULPE  0100
        !            21: #define        CPUNXM  0200
        !            22: #define        MEMCD0  0400
        !            23: #define        MEMCD1  01000
        !            24: #define        MEMCD   (MEMCD0|MEMCD1)
        !            25: 
        !            26: /*
        !            27:  * Machine check error recovery code.
        !            28:  * Print the machine check frame and reset things.
        !            29:  * Never recoverable in Mayflower.
        !            30:  * If in user mode, send a signal;
        !            31:  * if not and in kernel mode, panic.
        !            32:  */
        !            33: 
        !            34: machinecheck(ps, f)
        !            35: long ps;
        !            36: caddr_t f;
        !            37: {
        !            38:        int ok;
        !            39: 
        !            40:        mckrec(f);
        !            41:        machreset();
        !            42:        if (USERMODE(ps)) {
        !            43:                /*
        !            44:                 * code stolen from setrun
        !            45:                 */
        !            46:                runrun++;
        !            47:                aston();
        !            48:                psignal(u.u_procp, SIGBUS);
        !            49:                return;
        !            50:        }
        !            51:        panic("mchk");
        !            52: }
        !            53: 
        !            54: struct mc630frame {
        !            55:        long count;
        !            56:        long code;
        !            57:        long va;
        !            58:        long state;
        !            59:        long pc;
        !            60:        long psl;
        !            61: };
        !            62: 
        !            63: mckrec(f)
        !            64: register struct mc630frame *f;
        !            65: {
        !            66:        register char *pr;
        !            67:        register struct cpuregs *c;
        !            68:        register long m;
        !            69: 
        !            70:        printf("machine check type0x%x va0x%x st0x%x pc0x%x ps0x%x\n",
        !            71:                f->code, f->va, f->state, f->pc, f->psl);
        !            72:        switch (f->code) {
        !            73:        case 0x80:
        !            74:        case 0x81:
        !            75:                pr = "read";
        !            76:                break;
        !            77: 
        !            78:        case 0x82:
        !            79:        case 0x83:
        !            80:                pr = "write";
        !            81:                break;
        !            82: 
        !            83:        default:
        !            84:                return;
        !            85:        }
        !            86:        /*
        !            87:         * read or write error: what kind?
        !            88:         */
        !            89:        c = &((struct iomflow *)iospace)->c;
        !            90:        m = c->mser;
        !            91:        printf("%s err, mser0x%x\n", pr, m);
        !            92:        if (m & DMAQPE)
        !            93:                printf("qbus dma par, dear0x%x\n", c->dear);
        !            94:        if (m & CPUQPE)
        !            95:                printf("qbus cpu par, cear0x%x\n", c->cear);
        !            96:        if (m & CPULPE)
        !            97:                printf("local mem par, cear0x%x\n", c->cear);
        !            98:        if (m & CPUNXM)
        !            99:                printf("nxm\n");
        !           100:        if (m & (CPULPE|CPUQPE)) {
        !           101:                switch (m & MEMCD) {
        !           102:                case 0:
        !           103:                        pr = "Q22";
        !           104:                        break;
        !           105: 
        !           106:                case MEMCD0:
        !           107:                        pr = "onboard mem";
        !           108:                        break;
        !           109: 
        !           110:                default:
        !           111:                        pr = "exp mem";
        !           112:                        break;
        !           113:                }
        !           114:                printf("from %s\n", pr);
        !           115:        }
        !           116: }
        !           117: 
        !           118: /*
        !           119:  * reset processor error registers
        !           120:  */
        !           121: 
        !           122: machreset()
        !           123: {
        !           124:        register struct cpuregs *c;
        !           125: 
        !           126:        if (iospace == 0)
        !           127:                return;
        !           128:        c = &((struct iomflow *)iospace)->c;
        !           129:        c->mser = c->mser;
        !           130: }

unix.superglobalmegacorp.com

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