diff options
author | peter <peter@FreeBSD.org> | 2000-09-28 00:37:32 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-09-28 00:37:32 +0000 |
commit | 04e4b06d1c30bb8e2745b21af81279b6781b63f8 (patch) | |
tree | 679d118c3dc7d5fa696d505cff5e769004bc90d9 /sys/dev | |
parent | 3ebe63e32735ecf4534ed4218f679d30169d966a (diff) | |
download | FreeBSD-src-04e4b06d1c30bb8e2745b21af81279b6781b63f8.zip FreeBSD-src-04e4b06d1c30bb8e2745b21af81279b6781b63f8.tar.gz |
Get out the roto-rooter and clean up the abuse of nexus ivars by the
i386/isa/pcibus.c. This gets -current running again on multiple host->pci
machines after the most recent nexus commits. I had discussed this with
Mike Smith, but ended up doing it slightly differently to what we
discussed as it turned out cleaner this way. Mike was suggesting creating
a new resource (SYS_RES_PCIBUS) or something and using *_[gs]et_resource(),
but IMHO that wasn't ideal as SYS_RES_* is meant to be a global platform
property, not a quirk of a given implementation. This does use the ivar
methods but does so properly. It also now prints the physical pci bus that
a host->pci bridge (pcib) corresponds to.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/pcivar.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index 34df379..285e4ca 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -208,7 +208,7 @@ static __inline T pci_get_ ## A(device_t dev) \ \ static __inline void pci_set_ ## A(device_t dev, T t) \ { \ - u_long v = (u_long) t; \ + uintptr_t v = (uintptr_t) t; \ BUS_WRITE_IVAR(device_get_parent(dev), dev, PCI_IVAR_ ## B, v); \ } @@ -229,6 +229,8 @@ PCI_ACCESSOR(function, FUNCTION, u_int8_t) PCI_ACCESSOR(secondarybus, SECONDARYBUS, u_int8_t) PCI_ACCESSOR(subordinatebus, SUBORDINATEBUS, u_int8_t) +#undef PCI_ACCESSOR + static __inline u_int32_t pci_read_config(device_t dev, int reg, int width) { @@ -261,12 +263,14 @@ static __inline T pcib_get_ ## A(device_t dev) \ \ static __inline void pcib_set_ ## A(device_t dev, T t) \ { \ - u_long v = (u_long) t; \ + uintptr_t v = (uintptr_t) t; \ BUS_WRITE_IVAR(device_get_parent(dev), dev, PCIB_IVAR_ ## B, v); \ } PCIB_ACCESSOR(bus, BUS, u_int32_t) +#undef PCIB_ACCESSOR + #endif /* for compatibility to FreeBSD-2.2 and 3.x versions of PCI code */ |