summaryrefslogtreecommitdiffstats
path: root/sys/alpha/pci/tsunami.c
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>1999-10-12 22:10:53 +0000
committergallatin <gallatin@FreeBSD.org>1999-10-12 22:10:53 +0000
commitaaf5afc559ee01cf65d4a7cc2e849052a96534a7 (patch)
tree1c58bf2d0c15553dbd0c5adecbebbe14db4b5a8e /sys/alpha/pci/tsunami.c
parent229cdb91443142db582b7e32098f62f6446c3f3a (diff)
downloadFreeBSD-src-aaf5afc559ee01cf65d4a7cc2e849052a96534a7.zip
FreeBSD-src-aaf5afc559ee01cf65d4a7cc2e849052a96534a7.tar.gz
allow pci_ioctl to work with multi-hose alphas.
Rather than teaching pci_ioctl about hoses, we just pass down a magic number & let the platform code figure out what the hose is based on what the bus number is. concept approved by dfr
Diffstat (limited to 'sys/alpha/pci/tsunami.c')
-rw-r--r--sys/alpha/pci/tsunami.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/alpha/pci/tsunami.c b/sys/alpha/pci/tsunami.c
index 48cdd45..5468a62 100644
--- a/sys/alpha/pci/tsunami.c
+++ b/sys/alpha/pci/tsunami.c
@@ -275,9 +275,13 @@ tsunami_check_abort(void)
KV(TSUNAMI_CONF(h) | ((b) << 16) | ((s) << 11) | ((f) << 8) | (r))
#define CFGREAD(h, b, s, f, r, op, width, type) \
- int bus = tsunami_bus_within_hose(h, b) ? b : 0; \
- vm_offset_t va = TSUNAMI_CFGADDR(bus, s, f, r, h); \
+ int bus; \
+ vm_offset_t va; \
type data; \
+ if (h == (u_int8_t)-1) \
+ h = tsunami_hose_from_bus(b); \
+ bus = tsunami_bus_within_hose(h, b) ? b : 0; \
+ va = TSUNAMI_CFGADDR(bus, s, f, r, h); \
tsunami_clear_abort(); \
if (badaddr((caddr_t)va, width)) { \
tsunami_check_abort(); \
@@ -289,8 +293,12 @@ tsunami_check_abort(void)
return data;
#define CFWRITE(h, b, s, f, r, data, op, width) \
- int bus = tsunami_bus_within_hose(h, b) ? b : 0; \
- vm_offset_t va = TSUNAMI_CFGADDR(bus, s, f, r, h); \
+ int bus; \
+ vm_offset_t va; \
+ if (h == (u_int8_t)-1) \
+ h = tsunami_hose_from_bus(b); \
+ bus = tsunami_bus_within_hose(h, b) ? b : 0; \
+ va = TSUNAMI_CFGADDR(bus, s, f, r, h); \
tsunami_clear_abort(); \
if (badaddr((caddr_t)va, width)) \
return; \
OpenPOWER on IntegriCloud