diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-05-16 16:04:10 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-05-16 16:11:44 -0500 |
commit | 8bbf69e6e66aeee9add5b78d43c954e087b6a7f0 (patch) | |
tree | 7666e597a8d72982a77ae46ffb71017e255feac4 /c/src/lib/libbsp/mips | |
parent | mvme5500 and cpukit pci.h - Eliminate mvme5500 specific pci.h (diff) | |
download | rtems-8bbf69e6e66aeee9add5b78d43c954e087b6a7f0.tar.bz2 |
pci.h cleanup - Consolidate common defines to cpukit pci.h
+ libbsp/sparc/shared/include/pci.h was largely a copy of
an older version of the cpukit pci.h. Removed much of the
contents and included <rtems/pci.h>.
+ sparc/*/pci*.c - Move to <rtems/pci.h> required updating
to use uint32_t for dword accesses.
+ Rename PCI_MULTI_FUNCTION to PCI_HEADER_TYPE_MULTI_FUNCTION
+ Define PCI_HEADER_TYPE_MULTI_FUNCTION in cpukit pci.h and remove
PCI_MULTI_FUNCTION definitions in C files.
+ Move PCI_INVALID_VENDORDEVICEID definitions from various C files
to cpukit pci.h
Diffstat (limited to 'c/src/lib/libbsp/mips')
-rw-r--r-- | c/src/lib/libbsp/mips/malta/pci/pci.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/malta/pci/pcifinddevice.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/malta/pci/pcilistdevices.c | 5 |
3 files changed, 4 insertions, 12 deletions
diff --git a/c/src/lib/libbsp/mips/malta/pci/pci.c b/c/src/lib/libbsp/mips/malta/pci/pci.c index ab8949bcfe..2e8c7ff62c 100644 --- a/c/src/lib/libbsp/mips/malta/pci/pci.c +++ b/c/src/lib/libbsp/mips/malta/pci/pci.c @@ -37,9 +37,6 @@ #define PCI_CONFIG_DATA 0xcfc #endif -#define PCI_INVALID_VENDORDEVICEID 0xffffffff -#define PCI_MULTI_FUNCTION 0x80 - /* define a shortcut */ #define pci BSP_pci_configuration @@ -727,7 +724,7 @@ void FixupPCI( const struct _int_map *bspmap, int (*swizzler)(int,int) ) /* got a device */ pci_read_config_byte(pbus, pslot, 0, PCI_HEADER_TYPE, &cvalue); - nfuns = cvalue & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1; + nfuns = cvalue & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1; for (pfun=0; pfun< nfuns; pfun++) { pci_read_config_word(pbus, pslot, pfun, PCI_DEVICE_ID, &devid); @@ -1032,7 +1029,7 @@ int pci_initialize(void) } pci_read_config_byte(0, slot, 0, PCI_HEADER_TYPE, &ucHeader); - if (ucHeader & PCI_MULTI_FUNCTION) { + if (ucHeader & PCI_HEADER_TYPE_MULTI_FUNCTION) { ucNumFuncs = PCI_MAX_FUNCTIONS; } else { ucNumFuncs=1; diff --git a/c/src/lib/libbsp/mips/malta/pci/pcifinddevice.c b/c/src/lib/libbsp/mips/malta/pci/pcifinddevice.c index 2ef4eaff5e..d783a3817a 100644 --- a/c/src/lib/libbsp/mips/malta/pci/pcifinddevice.c +++ b/c/src/lib/libbsp/mips/malta/pci/pcifinddevice.c @@ -62,8 +62,6 @@ * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 */ -#define PCI_INVALID_VENDORDEVICEID 0xffffffff -#define PCI_MULTI_FUNCTION 0x80 #define PCI_DEBUG @@ -245,7 +243,7 @@ BSP_PciScanHandle BSP_pciScan( d ); #endif - hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); + hd = (hd & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); } (void)pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); diff --git a/c/src/lib/libbsp/mips/malta/pci/pcilistdevices.c b/c/src/lib/libbsp/mips/malta/pci/pcilistdevices.c index bc9907ed6f..310ae235d9 100644 --- a/c/src/lib/libbsp/mips/malta/pci/pcilistdevices.c +++ b/c/src/lib/libbsp/mips/malta/pci/pcilistdevices.c @@ -18,9 +18,6 @@ * List all PCI Devices */ -#define PCI_INVALID_VENDORDEVICEID 0xffffffff -#define PCI_MULTI_FUNCTION 0x80 - #define PCI_DEBUG #include <inttypes.h> @@ -92,7 +89,7 @@ void pci_list_devices( void ) if ( 0 == fun ) { pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); - hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); + hd = (hd & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); } (void)pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); |