diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-22 18:45:36 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-22 18:45:36 +0000 |
commit | 237902f111601f9346828cb265c832bcee546a16 (patch) | |
tree | fffa3d075dadcd013078a3d0d9af7d601f7556ec /sys/arch/mvme88k | |
parent | 96f7d97c76ba2b501d194732590931c651f0f592 (diff) |
Correct badvaddr() usage.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/dev/if_ie.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/if_ve.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwo.c | 27 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sshdma.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vx.c | 10 |
5 files changed, 31 insertions, 27 deletions
diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c index ab63348dac5..668080f5616 100644 --- a/sys/arch/mvme88k/dev/if_ie.c +++ b/sys/arch/mvme88k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.18 2001/12/16 23:49:46 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.19 2001/12/22 18:45:35 smurph Exp $ */ /*- * Copyright (c) 1998 Steve Murphree, Jr. @@ -352,9 +352,8 @@ iematch(parent, vcf, args) void *vcf, *args; { struct confargs *ca = args; - int ret; - if ((ret = badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)) <=0){ + if (badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)){ return(0); } return(1); diff --git a/sys/arch/mvme88k/dev/if_ve.c b/sys/arch/mvme88k/dev/if_ve.c index 66cf6fc8c43..ae165edc1c7 100644 --- a/sys/arch/mvme88k/dev/if_ve.c +++ b/sys/arch/mvme88k/dev/if_ve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ve.c,v 1.14 2001/12/22 09:49:39 smurph Exp $ */ +/* $OpenBSD: if_ve.c,v 1.15 2001/12/22 18:45:35 smurph Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1982, 1992, 1993 @@ -247,11 +247,9 @@ vematch(parent, vcf, args) { struct confargs *ca = args; - if (!badvaddr((unsigned)ca->ca_vaddr, 1)) { - return (1); - } else { + if (badvaddr((unsigned)ca->ca_vaddr, 1)) return (0); - } + return (1); } /* diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c index 9d889c57a11..b867d8812b3 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcctwo.c,v 1.14 2001/12/20 06:07:28 smurph Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.15 2001/12/22 18:45:35 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt * All rights reserved. @@ -54,6 +54,8 @@ #include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> +#include "bussw.h" + struct pcctwosoftc { struct device sc_dev; void *sc_vaddr; /* PCC2 space */ @@ -74,6 +76,8 @@ struct cfdriver pcctwo_cd = { struct pcctworeg *sys_pcc2 = NULL; +int pcc2bus; + int pcctwo_print __P((void *args, const char *bus)); int pcctwo_scan __P((struct device *parent, void *child, void *args)); @@ -98,7 +102,7 @@ void *vcf, *args; return (0); } - if (badvaddr((vm_offset_t)pcc2, 4) <= 0) { + if (badvaddr((vm_offset_t)pcc2, 4)) { printf("==> pcctwo: failed address check.\n"); return (0); } @@ -173,13 +177,26 @@ void *args; */ sc->sc_paddr = ca->ca_paddr; sc->sc_vaddr = (void *)IIOV(sc->sc_paddr); - switch (brdtyp) { - case BRD_187: + + pcc2bus = ca->ca_bustype; + + switch (pcc2bus) { + case BUS_MAIN: sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF); break; - case BRD_197: /* pcctwo is a child of buswitch XXX smurph */ +#if NBUSSW > 0 + case BUS_BUSSWITCH: sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr; + /* + * fake up our address so that pcc2 child devices + * are offeset of 0xFFF00000 - XXX smurph + */ + sc->sc_paddr -= PCC2_PCC2CHIP_OFF; + sc->sc_vaddr -= PCC2_PCC2CHIP_OFF; + /* make sure the bus is mc68040 compatible */ + sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_C040; break; +#endif } sys_pcc2 = sc->sc_pcc2; diff --git a/sys/arch/mvme88k/dev/sshdma.c b/sys/arch/mvme88k/dev/sshdma.c index e6fa59c9bff..5aa58bed51e 100644 --- a/sys/arch/mvme88k/dev/sshdma.c +++ b/sys/arch/mvme88k/dev/sshdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshdma.c,v 1.9 2001/12/16 23:49:46 miod Exp $ */ +/* $OpenBSD: sshdma.c,v 1.10 2001/12/22 18:45:35 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur @@ -99,10 +99,8 @@ afscmatch(pdp, vcf, args) void *vcf, *args; { struct confargs *ca = args; - int ret; - if ((ret = badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) <=0){ - printf("==> ssh: failed address check returning %ld.\n", ret); + if (badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) { return(0); } @@ -176,10 +174,8 @@ afscattach(parent, self, auxp) CACHE_INH); pcctwointr_establish(PCC2V_NCR, &sc->sc_ih); -/* intr_establish(PCC2_VECT + SCSIIRQ, &sc->sc_ih);*/ /* enable interrupts at ca_ipl */ pcc2->pcc2_ncrirq = ca->ca_ipl | PCC2_IRQ_IEN; -/* pcc2->pcc2_scsiirq = ca->ca_ipl | PCC2_SCSIIRQ_IEN;*/ break; } #endif diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index af00446df81..cfe002d53ff 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.15 2001/12/19 07:04:41 smurph Exp $ */ +/* $OpenBSD: vx.c,v 1.16 2001/12/22 18:45:35 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -205,15 +205,9 @@ vxmatch(parent, self, aux) vx_reg = (struct vxreg *)ca->ca_vaddr; board_addr = (unsigned int)ca->ca_vaddr; - if (!badvaddr((unsigned)&vx_reg->ipc_cr, 1)) { - if (ca->ca_vec & 0x03) { - printf("xvt: bad vector 0x%x\n", ca->ca_vec); + if (badvaddr((unsigned)&vx_reg->ipc_cr, 1)) return (0); - } return (1); - } else { - return (0); - } } void |