summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-06 21:34:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-06 21:34:39 +0000
commite107f5ff08e0dfd5ecce9948a5af2a41584532bb (patch)
tree4d3bef29c21d44bfa5693f3fb5ec6f59143a80df /sys/arch
parent3170eba396d496dea538384b36112bba432769c9 (diff)
avoid bus_tmp() because mapiodev() may reuse that mapping, which would be a catastrophe
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/pfour.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/arch/sparc/dev/pfour.c b/sys/arch/sparc/dev/pfour.c
index 48d555b3773..46404373724 100644
--- a/sys/arch/sparc/dev/pfour.c
+++ b/sys/arch/sparc/dev/pfour.c
@@ -85,33 +85,30 @@ pfourattach(parent, self, args)
struct confargs oca;
register short *p;
struct cfdata *cf;
- caddr_t tmp;
- u_int val;
+ u_long val;
if (sc->sc_dev.dv_unit > 0) {
printf(" unsupported\n");
return;
}
- tmp = bus_tmp(ca->ca_ra.ra_paddr + PFOUR_REG, BUS_PFOUR);
- if (tmp == NULL) {
+ sc->sc_vaddr = (u_long *)mapiodev((caddr_t)(ca->ca_ra.ra_paddr + PFOUR_REG),
+ NBPG, ca->ca_bustype);
+ if (sc->sc_vaddr == NULL) {
printf("\n");
return;
}
- val = probeget(tmp, 4);
+ val = probeget(sc->sc_vaddr, 4);
if (val == -1) {
printf(": empty\n");
return;
}
- sc->sc_vaddr = mapiodev((caddr_t)(ca->ca_ra.ra_paddr + PFOUR_REG),
- NBPG, ca->ca_bustype);
-
printf(": cardtype 0x%02x\n", PFOUR_FBTYPE(val));
- *(int *)tmp = PFOUR_REG_VIDEO | PFOUR_REG_RESET;
- *(int *)tmp = PFOUR_REG_VIDEO;
+ *sc->sc_vaddr = PFOUR_REG_VIDEO | PFOUR_REG_RESET;
+ *sc->sc_vaddr = PFOUR_REG_VIDEO;
for (cf = cfdata; cf->cf_driver; cf++) {
if (cf->cf_fstate == FSTATE_FOUND)
@@ -133,7 +130,6 @@ pfourattach(parent, self, args)
config_attach(self, cf, &oca, NULL);
}
}
- bus_untmp();
}
void