diff options
Diffstat (limited to 'hw/xfree86/os-support/bus/Pci.h')
-rw-r--r-- | hw/xfree86/os-support/bus/Pci.h | 127 |
1 files changed, 10 insertions, 117 deletions
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index f0cb916da..632a7a048 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -157,50 +157,6 @@ #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u) /* - * Macros for bus numbers found in P2P headers. - */ -#define PCI_PRIMARY_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_PRIMARY_BUS_MASK ) >> 0) | (PCI_DOM_FROM_TAG(tag) << 8)) -#define PCI_SECONDARY_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_SECONDARY_BUS_MASK ) >> 8) | (PCI_DOM_FROM_TAG(tag) << 8)) -#define PCI_SUBORDINATE_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_SUBORDINATE_BUS_MASK) >> 16) | (PCI_DOM_FROM_TAG(tag) << 8)) - -#define PCI_PRIMARY_BUS_INSERT(x, y) \ - (((x) & ~PCI_PRIMARY_BUS_MASK ) | (((y) & 0xffu) << 0)) -#define PCI_SECONDARY_BUS_INSERT(x, y) \ - (((x) & ~PCI_SECONDARY_BUS_MASK ) | (((y) & 0xffu) << 8)) -#define PCI_SUBORDINATE_BUS_INSERT(x, y) \ - (((x) & ~PCI_SUBORDINATE_BUS_MASK) | (((y) & 0xffu) << 16)) - -/* Ditto for CardBus bridges */ -#define PCI_CB_PRIMARY_BUS_EXTRACT(x, tag) \ - PCI_PRIMARY_BUS_EXTRACT(x, tag) -#define PCI_CB_CARDBUS_BUS_EXTRACT(x, tag) \ - PCI_SECONDARY_BUS_EXTRACT(x, tag) -#define PCI_CB_SUBORDINATE_BUS_EXTRACT(x, tag) \ - PCI_SUBORDINATE_BUS_EXTRACT(x, tag) - -#define PCI_CB_PRIMARY_BUS_INSERT(x, tag) \ - PCI_PRIMARY_BUS_INSERT(x, tag) -#define PCI_CB_CARDBUS_BUS_INSERT(x, tag) \ - PCI_SECONDARY_BUS_INSERT(x, tag) -#define PCI_CB_SUBORDINATE_BUS_INSERT(x, tag) \ - PCI_SUBORDINATE_BUS_INSERT(x, tag) - -#if X_BYTE_ORDER == X_BIG_ENDIAN -#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \ - ((val >> 8) & 0x0000ff00) | \ - ((val << 8) & 0x00ff0000) | \ - ((val << 24) & 0xff000000)) -#define PCI_CPU16(val) (((val >> 8) & 0x000000ff) | \ - ((val << 8) & 0x0000ff00)) -#else -#define PCI_CPU(val) (val) -#define PCI_CPU16(val) (val) -#endif - -/* * Debug Macros/Definitions */ /* #define DEBUGPCI 2 */ /* Disable/enable trace in PCI code */ @@ -234,97 +190,79 @@ #if defined(__alpha__) # if defined(linux) # define ARCH_PCI_INIT axpPciInit -# define INCLUDE_XF86_MAP_PCI_MEM -# elif defined(__FreeBSD__) || defined(__OpenBSD__) +# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) # define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # elif defined(__NetBSD__) # define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__arm__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__hppa__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__ia64__) # if defined(linux) # define ARCH_PCI_INIT ia64linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # elif defined(FreeBSD) # define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif # define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper #elif defined(__i386__) || defined(i386) -# define ARCH_PCI_INIT ix86PciInit -# define INCLUDE_XF86_MAP_PCI_MEM -# define INCLUDE_XF86_NO_DOMAIN # if defined(linux) -# define ARCH_PCI_OS_INIT linuxPciInit +# define ARCH_PCI_INIT linuxPciInit +# else +# define ARCH_PCI_INIT ix86PciInit # endif +# define INCLUDE_XF86_NO_DOMAIN #elif defined(__mc68000__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__mips__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__powerpc__) || defined(__powerpc64__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */ # elif defined(__FreeBSD__) || defined(__OpenBSD__) # define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # elif defined(__NetBSD__) # define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # else # define ARCH_PCI_INIT ppcPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__s390__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sh__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sparc__) || defined(sparc) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # elif defined(sun) # define ARCH_PCI_INIT sparcPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__) # define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif # if !defined(__FreeBSD__) && !defined(linux) @@ -333,28 +271,21 @@ #elif defined(__amd64__) || defined(__amd64) # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # define ARCH_PCI_INIT freebsdPciInit +# elif defined(linux) +# define ARCH_PCI_INIT linuxPciInit # else # define ARCH_PCI_INIT ix86PciInit # endif -# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN -# if defined(linux) -# define ARCH_PCI_OS_INIT linuxPciInit -# endif #endif #ifndef ARCH_PCI_INIT #error No PCI support available for this architecture/OS combination #endif -extern void ARCH_PCI_INIT(void); -#if defined(ARCH_PCI_OS_INIT) -extern void ARCH_PCI_OS_INIT(void); -#endif +#undef INCLUDE_XF86_NO_DOMAIN -#if defined(ARCH_PCI_PCI_BRIDGE) -extern void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI); -#endif +extern void ARCH_PCI_INIT(void); #if defined(XF86SCANPCI_WRAPPER) typedef enum { @@ -369,27 +300,7 @@ extern void XF86SCANPCI_WRAPPER(scanpciWrapperOpt flags); * (e.g. a primary PCI bus and all of its secondaries) */ typedef struct pci_bus_funcs { - CARD32 (*pciReadLong)(PCITAG, int); - void (*pciWriteLong)(PCITAG, int, CARD32); - void (*pciSetBitsLong)(PCITAG, int, CARD32, CARD32); - ADDRESS (*pciAddrHostToBus)(PCITAG, PciAddrType, ADDRESS); ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS); - /* - * The next three are optional. If NULL, the corresponding function is - * to be performed generically. - */ - CARD16 (*pciControlBridge)(int, CARD16, CARD16); - void (*pciGetBridgeBuses)(int, int *, int *, int *); - /* Use pointer's to avoid #include recursion */ - void (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *); - - /* These are optional and will be implemented using read long - * if not present. */ - CARD8 (*pciReadByte)(PCITAG, int); - void (*pciWriteByte)(PCITAG, int, CARD8); - CARD16 (*pciReadWord)(PCITAG, int); - void (*pciWriteWord)(PCITAG, int, CARD16); - } pciBusFuncs_t, *pciBusFuncs_p; /* @@ -402,7 +313,7 @@ typedef struct pci_bus_info { int primary_bus; /* Parent bus */ pciBusFuncs_p funcs; /* PCI access functions */ void *pciBusPriv; /* Implementation private data */ - pciConfigPtr bridge; /* bridge that opens this bus */ + struct pci_device *bridge; /* bridge that opens this bus */ } pciBusInfo_t; #define HOST_NO_BUS ((pciBusInfo_t *)(-1)) @@ -414,32 +325,14 @@ typedef struct pci_bus_info { #define PCI_CFG_MECH_OTHER 3 /* Something else */ /* Generic PCI service functions and helpers */ -PCITAG pciGenFindFirst(void); -PCITAG pciGenFindNext(void); CARD32 pciCfgMech1Read(PCITAG tag, int offset); void pciCfgMech1Write(PCITAG tag, int offset, CARD32 val); void pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask, CARD32 val); -CARD32 pciByteSwap(CARD32); -Bool pciMfDev(int, int); ADDRESS pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS); -extern void pciSetOSBIOSPtr(int (*bios_fn)(PCITAG Tag, int basereg, unsigned char * buf, int len)); -extern PCITAG (*pciFindFirstFP)(void); -extern PCITAG (*pciFindNextFP)(void); - -extern CARD32 pciDevid; -extern CARD32 pciDevidMask; - extern int pciMaxBusNum; -extern int pciBusNum; -extern int pciDevNum; -extern int pciFuncNum; -extern PCITAG pciDeviceTag; - -extern int xf86MaxPciDevs; - extern pciBusInfo_t *pciBusInfo[]; #endif /* _PCI_H */ |