diff options
author | Adam Jackson <ajax@redhat.com> | 2008-10-08 23:45:40 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-11-24 23:40:02 -0500 |
commit | 86cfe0ee236bfd3613e5f9ba589211db42d009eb (patch) | |
tree | 891180987d228365669924e5628529d3fafa1c27 | |
parent | 2d427b9cb1594f8f2f66b463033fff5b459962fd (diff) |
PCI: Simplify OS PCI function registration a bit.
-rw-r--r-- | hw/xfree86/os-support/bus/Pci.c | 6 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/Pci.h | 16 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/bsd_pci.c | 15 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/linuxPci.c | 11 |
4 files changed, 5 insertions, 43 deletions
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index 5dccd39dc..888a9e36d 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -138,13 +138,13 @@ /* Global data */ -pciBusInfo_t *pciBusInfo = NULL; +pciBusFuncs_t *pciBusFuncs = NULL; _X_EXPORT ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr) { - if (pciBusInfo->funcs->pciAddrBusToHost) - return pciBusInfo->funcs->pciAddrBusToHost(tag, type, addr); + if (pciBusFuncs && pciBusFuncs->pciAddrBusToHost) + return pciBusFuncs->pciAddrBusToHost(tag, type, addr); else return addr; } diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 285c7a558..5feb73349 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -191,23 +191,9 @@ typedef struct pci_bus_funcs { ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS); } pciBusFuncs_t, *pciBusFuncs_p; -/* - * pciBusInfo_t - One structure per defined PCI bus - */ -typedef struct pci_bus_info { - unsigned char numDevices; /* Range of valid devnums */ - unsigned char secondary; /* Boolean: bus is a secondary */ - int primary_bus; /* Parent bus */ - pciBusFuncs_p funcs; /* PCI access functions */ - void *pciBusPriv; /* Implementation private data */ - struct pci_device *bridge; /* bridge that opens this bus */ -} pciBusInfo_t; - -#define HOST_NO_BUS ((pciBusInfo_t *)(-1)) - /* Generic PCI service functions and helpers */ ADDRESS pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS); -extern pciBusInfo_t *pciBusInfo; +extern pciBusFuncs_t *pciBusFuncs; #endif /* _PCI_H */ diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c index cfdd98641..9b55d3a44 100644 --- a/hw/xfree86/os-support/bus/bsd_pci.c +++ b/hw/xfree86/os-support/bus/bsd_pci.c @@ -48,19 +48,6 @@ #include "pciaccess.h" -static pciBusFuncs_t bsd_funcs = { - .pciAddrBusToHost = pciAddrNOOP, -}; - -static pciBusInfo_t bsd_pci = { - .numDevices = 32, - .secondary = FALSE, - .primary_bus = 0, - .funcs = &bsd_funcs, - .pciBusPriv = NULL, - .bridge = NULL, -}; - _X_EXPORT pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev, ADDRESS Base, unsigned long Size) @@ -78,7 +65,5 @@ xf86MapLegacyIO(struct pci_device *dev) void bsdPciInit(void) { - pciBusInfo = &bsd_pci; - xf86InitVidMem(); } diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index 28b0aec95..263fd8ff1 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -79,15 +79,6 @@ static pciBusFuncs_t linuxFuncs0 = { #endif }; -static pciBusInfo_t linuxPci0 = { -/* numDevices */ 32, -/* secondary */ FALSE, -/* primary_bus */ 0, -/* funcs */ &linuxFuncs0, -/* pciBusPriv */ NULL, -/* bridge */ NULL -}; - static const struct pci_id_match match_host_bridge = { PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, (PCI_CLASS_BRIDGE << 16) | (PCI_SUBCLASS_BRIDGE_HOST << 8), @@ -109,7 +100,7 @@ linuxPciInit(void) we'll need a fallback for 2.0 kernels here */ return; } - pciBusInfo = &linuxPci0; + pciBusFuncs = &linuxFuncs0; } /** |