diff options
author | Chris Johns <chrisj@rtems.org> | 2015-05-27 10:42:28 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-06-01 10:36:58 +1000 |
commit | 1383c80c5ae53f5ab399122034dc967c667abc15 (patch) | |
tree | 7e1b24c1eda4536246a141024edbc8c72bd0205d /rtemsbsd/rtems/rtems-bsd-pci_bus.c | |
parent | Regenerate with FreeBSD lex, yacc, and rpcgen tools. (diff) | |
download | rtems-libbsd-1383c80c5ae53f5ab399122034dc967c667abc15.tar.bz2 |
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.
Diffstat (limited to 'rtemsbsd/rtems/rtems-bsd-pci_bus.c')
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-pci_bus.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rtemsbsd/rtems/rtems-bsd-pci_bus.c b/rtemsbsd/rtems/rtems-bsd-pci_bus.c index f673083b..f687e0f5 100644 --- a/rtemsbsd/rtems/rtems-bsd-pci_bus.c +++ b/rtemsbsd/rtems/rtems-bsd-pci_bus.c @@ -52,21 +52,27 @@ __FBSDID("$FreeBSD$"); #include <rtems/bsd/local/pcib_if.h> #define pci_find_device rtems_pci_find_device +#if HAVE_RTEMS_PCI_H #include <rtems/pci.h> +#endif #include <machine/bus.h> int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin) { +#if HAVE_RTEMS_PCI_H int bus; int slot; int func; uint8_t irq; - + bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); pci_read_config_byte(bus, slot, func, PCI_INTERRUPT_LINE, &irq); return irq; +#else + return 0; +#endif } |