diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1996-11-23 07:55:10 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1996-11-23 07:55:10 +0000 |
commit | df68e5d49bd93c29dab9220debdf630c32fe8c3f (patch) | |
tree | ec1558b565ce6e208d34b2348260e818f1222ce1 /sys/arch/sun3/dev/memerr.c | |
parent | 83cf43dbb741a19e8f7e7b4d69b91d78167dc970 (diff) |
sync with NetBSD
Diffstat (limited to 'sys/arch/sun3/dev/memerr.c')
-rw-r--r-- | sys/arch/sun3/dev/memerr.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/sun3/dev/memerr.c b/sys/arch/sun3/dev/memerr.c index e71b10f4c7a..676aef73f96 100644 --- a/sys/arch/sun3/dev/memerr.c +++ b/sys/arch/sun3/dev/memerr.c @@ -1,4 +1,4 @@ -/* $NetBSD: memerr.c,v 1.2 1996/04/07 05:47:28 gwr Exp $ */ +/* $NetBSD: memerr.c,v 1.6 1996/11/13 07:05:14 thorpej Exp $ */ /* * Copyright (c) 1992, 1993 @@ -92,22 +92,20 @@ memerr_match(parent, vcf, args) { struct cfdata *cf = vcf; struct confargs *ca = args; - int pa, x; /* This driver only supports one unit. */ if (cf->cf_unit != 0) return (0); - if ((pa = cf->cf_paddr) == -1) { - /* Use our default PA. */ - pa = OBIO_MEMERR; - } - if (pa != ca->ca_paddr) + /* The peek returns -1 on bus error. */ + if (bus_peek(ca->ca_bustype, ca->ca_paddr, 1) == -1) return (0); - /* The peek returns -1 on bus error. */ - x = bus_peek(ca->ca_bustype, ca->ca_paddr, 1); - return (x != -1); + /* Default interrupt priority. */ + if (ca->ca_intpri == -1) + ca->ca_intpri = ME_PRI; + + return (1); } static void @@ -120,12 +118,6 @@ memerr_attach(parent, self, args) struct confargs *ca = args; struct memerr *mer; - mer = (struct memerr *) - obio_alloc(ca->ca_paddr, sizeof(*mer)); - if (mer == NULL) - panic(": can not map register"); - sc->sc_reg = mer; - /* * Which type of memory subsystem do we have? */ @@ -143,11 +135,17 @@ memerr_attach(parent, self, args) sc->sc_csrbits = ME_PAR_STR; break; } + printf(": (%s memory)\n", sc->sc_typename); - printf(" (%s memory)\n", sc->sc_typename); + mer = (struct memerr *) + obio_alloc(ca->ca_paddr, sizeof(*mer)); + if (mer == NULL) + panic("memerr: can not map register"); + sc->sc_reg = mer; /* Install interrupt handler. */ - isr_add_autovect(memerr_interrupt, (void *)sc, ME_PRI); + isr_add_autovect(memerr_interrupt, + (void *)sc, ca->ca_intpri); /* Enable error interrupt (and checking). */ if (sc->sc_type == ME_PAR) @@ -175,6 +173,7 @@ memerr_interrupt(arg) u_char csr, ctx, err; u_int pa, va; int pte; + char bits[64]; csr = me->me_csr; if ((csr & ME_CSR_IPEND) == 0) @@ -190,7 +189,8 @@ memerr_interrupt(arg) (ctx & 8) ? "DVMA" : "CPU"); printf(" ctx=%d, vaddr=0x%x, paddr=0x%x\n", (ctx & 7), va, pa); - printf(" csr=%b\n", csr, sc->sc_csrbits); + printf(" csr=%s\n", bitmask_snprintf(csr, sc->sc_csrbits, + bits, sizeof(bits))); /* * If we have parity-checked memory, there is |