From 1383c80c5ae53f5ab399122034dc967c667abc15 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 27 May 2015 10:42:28 +1000 Subject: Add conditional support for RTEMS PCI to the waf build. Check for the "rtems/pci.h" header and provide conditional build support with waf to build for BSPs that do not have PCI support. The Makefile build always defines HAVE_RTEMS_PCI_H which is the same state with this change. The PCI calls still exist however they do nothing and return a constant. Any PCI based driver that makes these calls on a BSP that does not have PCI support will not work which is understandable. Either change the driver or add PCI support the BSP. --- rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c') diff --git a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c index f126c31f..b9bdd31b 100644 --- a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c +++ b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c @@ -49,11 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include #define pci_find_device rtems_pci_find_device +#if HAVE_RTEMS_PCI_H #include +#endif - -/* - * Initialise access to PCI configuration space +/* + * Initialise access to PCI configuration space */ int pci_cfgregopen(void) @@ -61,12 +62,13 @@ pci_cfgregopen(void) return(1); } -/* +/* * Read configuration space register */ u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes) { +#if HAVE_RTEMS_PCI_H u_int32_t value; uint8_t v8; uint16_t v16; @@ -89,14 +91,18 @@ pci_cfgregread(int bus, int slot, int func, int reg, int bytes) } return value; +#else + return 0; +#endif } -/* - * Write configuration space register +/* + * Write configuration space register */ void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes) { +#if HAVE_RTEMS_PCI_H uint8_t v8 = data & 0xff; uint16_t v16 = data & 0xffff; uint32_t v32 = data; @@ -112,4 +118,5 @@ pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes) pci_write_config_dword( bus, slot, func, reg, v32 ); break; } +#endif } -- cgit v1.2.3