Annotation of 43BSDReno/sys/vax/ka750.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  *
        !             6:  *     @(#)ka750.c     7.2 (Berkeley) 7/9/88
        !             7:  */
        !             8: 
        !             9: #if VAX750
        !            10: 
        !            11: /*
        !            12:  * 750-specific code.
        !            13:  */
        !            14: 
        !            15: #include "param.h"
        !            16: 
        !            17: #include "cpu.h"
        !            18: #include "mem.h"
        !            19: #include "mtpr.h"
        !            20: 
        !            21: struct mcr750 {
        !            22:        int     mc_err;                 /* error bits */
        !            23:        int     mc_inh;                 /* inhibit crd */
        !            24: };
        !            25: 
        !            26: #define        M750_ICRD       0x10000000      /* inhibit crd interrupts, in [1] */
        !            27: #define        M750_UNCORR     0xc0000000      /* uncorrectable error, in [0] */
        !            28: #define        M750_CORERR     0x20000000      /* correctable error, in [0] */
        !            29: 
        !            30: #define        M750_INH(mcr)   ((mcr)->mc_inh = 0)
        !            31: #define        M750_ENA(mcr)   ((mcr)->mc_err = (M750_UNCORR|M750_CORERR), \
        !            32:                         (mcr)->mc_inh = M750_ICRD)
        !            33: #define        M750_ERR(mcr)   ((mcr)->mc_err & (M750_UNCORR|M750_CORERR))
        !            34: 
        !            35: #define        M750_SYN(err)   ((err) & 0x7f)
        !            36: #define        M750_ADDR(err)  (((err) >> 9) & 0x7fff)
        !            37: 
        !            38: /* enable crd interrupts */
        !            39: ka750_memenable()
        !            40: {
        !            41: 
        !            42:        M750_ENA((struct mcr750 *)mcraddr[0]);
        !            43: }
        !            44: 
        !            45: /* log crd errors */
        !            46: ka750_memerr()
        !            47: {
        !            48:        register struct mcr750 *mcr = (struct mcr750 *)mcraddr[0];
        !            49:        register int err;
        !            50: 
        !            51:        if (M750_ERR(mcr)) {
        !            52:                err = mcr->mc_err;      /* careful with i/o space refs */
        !            53:                printf("mcr0: %s", err & M750_UNCORR ?
        !            54:                    "hard error" : "soft ecc");
        !            55:                printf(" addr %x syn %x\n", M750_ADDR(err), M750_SYN(err));
        !            56:                M750_INH(mcr);
        !            57:        }
        !            58: }
        !            59: 
        !            60: extern char *mc780750[];
        !            61: 
        !            62: struct mc750frame {
        !            63:        int     mc5_bcnt;               /* byte count == 0x28 */
        !            64:        int     mc5_summary;            /* summary parameter (as above) */
        !            65:        int     mc5_va;                 /* virtual address register */
        !            66:        int     mc5_errpc;              /* error pc */
        !            67:        int     mc5_mdr;
        !            68:        int     mc5_svmode;             /* saved mode register */
        !            69:        int     mc5_rdtimo;             /* read lock timeout */
        !            70:        int     mc5_tbgpar;             /* tb group parity error register */
        !            71:        int     mc5_cacherr;            /* cache error register */
        !            72:        int     mc5_buserr;             /* bus error register */
        !            73:        int     mc5_mcesr;              /* machine check status register */
        !            74:        int     mc5_pc;                 /* trapped pc */
        !            75:        int     mc5_psl;                /* trapped psl */
        !            76: };
        !            77: 
        !            78: #define MC750_TBERR    2               /* type code of cp tbuf par */
        !            79: #define        MC750_TBPAR     4               /* tbuf par bit in mcesr */
        !            80: 
        !            81: ka750_mchk(cmcf)
        !            82:        caddr_t cmcf;
        !            83: {
        !            84:        register struct mc750frame *mcf = (struct mc750frame *)cmcf;
        !            85:        register int type = mcf->mc5_summary;
        !            86:        int mcsr = mfpr(MCSR);
        !            87: 
        !            88:        printf("machine check %x: %s%s\n", type, mc780750[type&0xf],
        !            89:            (type&0xf0) ? " abort" : " fault"); 
        !            90:        mtpr(TBIA, 0);
        !            91:        mtpr(MCESR, 0xf);
        !            92:        printf(
        !            93: "\tva %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x\n",
        !            94:            mcf->mc5_va, mcf->mc5_errpc, mcf->mc5_mdr, mcf->mc5_svmode,
        !            95:            mcf->mc5_rdtimo, mcf->mc5_tbgpar, mcf->mc5_cacherr);
        !            96:        printf("\tbuserr %x mcesr %x pc %x psl %x mcsr %x\n",
        !            97:            mcf->mc5_buserr, mcf->mc5_mcesr, mcf->mc5_pc, mcf->mc5_psl,
        !            98:            mcsr);
        !            99:        if (type == MC750_TBERR && (mcf->mc5_mcesr&0xe) == MC750_TBPAR) {
        !           100:                printf("tbuf par: flushing and returning\n");
        !           101:                return (MCHK_RECOVERED);
        !           102:        }
        !           103:        return (MCHK_PANIC);
        !           104: }
        !           105: #endif

unix.superglobalmegacorp.com

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