summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-05 21:55:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-05 21:55:10 +0000
commitee1f2022ccc40f4af881773718c7235d4ea5e4e7 (patch)
tree58cadf866191b9f7ab134f93b5e535d7cf99a9ba /sys/arch
parentdc7b7fb3a204fb20f936d3196b855b7027f967c0 (diff)
calculate ca_offset correctly
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/qec.c6
-rw-r--r--sys/arch/sparc/dev/qecvar.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/sparc/dev/qec.c b/sys/arch/sparc/dev/qec.c
index 6b68f3ffaa1..a37cdce4276 100644
--- a/sys/arch/sparc/dev/qec.c
+++ b/sys/arch/sparc/dev/qec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qec.c,v 1.10 1998/11/16 06:20:36 jason Exp $ */
+/* $OpenBSD: qec.c,v 1.11 1999/07/05 21:55:09 deraadt Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt and Jason L. Wright.
@@ -119,6 +119,7 @@ qecattach(parent, self, aux)
sc->sc_regs = mapiodev(&ca->ca_ra.ra_reg[0], 0,
sizeof(struct qecregs));
sc->sc_bufsiz = ca->ca_ra.ra_reg[1].rr_len;
+ sc->sc_paddr = ca->ca_ra.ra_reg[0].rr_paddr;
/*
* On qec+qe, the qec has the interrupt priority, but we
@@ -226,10 +227,11 @@ qec_translate(sc, ca)
struct qec_softc *sc;
struct confargs *ca;
{
+ static int dev = 0;
register int i;
ca->ca_slot = ca->ca_ra.ra_iospace;
- ca->ca_offset = (int)ca->ca_ra.ra_paddr;
+ ca->ca_offset = sc->sc_range[dev++].poffset - (long)sc->sc_paddr;
/* Translate into parent address spaces */
for (i = 0; i < ca->ca_ra.ra_nreg; i++) {
diff --git a/sys/arch/sparc/dev/qecvar.h b/sys/arch/sparc/dev/qecvar.h
index 4cc437bea63..8a0237ddbc0 100644
--- a/sys/arch/sparc/dev/qecvar.h
+++ b/sys/arch/sparc/dev/qecvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qecvar.h,v 1.6 1998/11/02 05:50:59 jason Exp $ */
+/* $OpenBSD: qecvar.h,v 1.7 1999/07/05 21:55:09 deraadt Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt and Jason L. Wright.
@@ -38,6 +38,7 @@ struct qec_softc {
int sc_nchannels; /* number of channels on board */
int sc_nrange; /* number of ranges */
struct rom_range *sc_range; /* array of ranges */
+ void *sc_paddr;
/*
* For use by children: