diff options
author | Thomas Heijligen <thomas.heijligen@secunet.com> | 2021-11-02 21:03:00 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2021-12-22 12:33:15 +0000 |
commit | 88c871e74cb9d8b6f6f38747d1caae916364e2a2 (patch) | |
tree | 976da5400ced468d2b1862977a2c138c2ae32f54 | |
parent | 9469f81d8f8154e7e71890ca94aaee8d550093ac (diff) | |
download | flashrom-88c871e74cb9d8b6f6f38747d1caae916364e2a2.tar.gz flashrom-88c871e74cb9d8b6f6f38747d1caae916364e2a2.tar.bz2 flashrom-88c871e74cb9d8b6f6f38747d1caae916364e2a2.zip |
pci.h: move include into own wrapper
Split the include of hwaccess and libpci. There is no need to have pci.h
included in hwaccess.
Change-Id: Ibf00356f0ef5cc92e0ec99f8fe5cdda56f47b166
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/58883
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r-- | amd_imc.c | 1 | ||||
-rw-r--r-- | atahpt.c | 1 | ||||
-rw-r--r-- | atapromise.c | 1 | ||||
-rw-r--r-- | atavia.c | 1 | ||||
-rw-r--r-- | board_enable.c | 1 | ||||
-rw-r--r-- | chipset_enable.c | 1 | ||||
-rw-r--r-- | drkaiser.c | 1 | ||||
-rw-r--r-- | gfxnvidia.c | 1 | ||||
-rw-r--r-- | hwaccess.h | 17 | ||||
-rw-r--r-- | internal.c | 1 | ||||
-rw-r--r-- | it8212.c | 1 | ||||
-rw-r--r-- | mcp6x_spi.c | 1 | ||||
-rw-r--r-- | nic3com.c | 1 | ||||
-rw-r--r-- | nicintel.c | 1 | ||||
-rw-r--r-- | nicintel_eeprom.c | 1 | ||||
-rw-r--r-- | nicintel_spi.c | 1 | ||||
-rw-r--r-- | nicnatsemi.c | 1 | ||||
-rw-r--r-- | nicrealtek.c | 1 | ||||
-rw-r--r-- | ogp_spi.c | 1 | ||||
-rw-r--r-- | pcidev.c | 2 | ||||
-rw-r--r-- | platform/pci.h | 25 | ||||
-rw-r--r-- | satamv.c | 1 | ||||
-rw-r--r-- | satasii.c | 1 | ||||
-rw-r--r-- | sb600spi.c | 1 |
24 files changed, 47 insertions, 18 deletions
@@ -19,6 +19,7 @@ #include "programmer.h" #include "hwaccess.h" #include "spi.h" +#include "platform/pci.h" /* same as serverengines */ static void enter_conf_mode_ec(uint16_t port) @@ -19,6 +19,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define BIOS_ROM_ADDR 0x90 #define BIOS_ROM_DATA 0x94 diff --git a/atapromise.c b/atapromise.c index 0c187e3cf..92eba0c2b 100644 --- a/atapromise.c +++ b/atapromise.c @@ -19,6 +19,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define MAX_ROM_DECODE (32 * 1024) #define ADDR_MASK (MAX_ROM_DECODE - 1) @@ -21,6 +21,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_VIA 0x1106 diff --git a/board_enable.c b/board_enable.c index 9cf01031a..339408a55 100644 --- a/board_enable.c +++ b/board_enable.c @@ -26,6 +26,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #if defined(__i386__) || defined(__x86_64__) /* diff --git a/chipset_enable.c b/chipset_enable.c index 2e4bb1e4a..858844318 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -34,6 +34,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define NOT_DONE_YET 1 diff --git a/drkaiser.c b/drkaiser.c index 27c15fbbf..34b204e68 100644 --- a/drkaiser.c +++ b/drkaiser.c @@ -18,6 +18,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_DRKAISER 0x1803 diff --git a/gfxnvidia.c b/gfxnvidia.c index 048471d3c..e85ce68c7 100644 --- a/gfxnvidia.c +++ b/gfxnvidia.c @@ -19,6 +19,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_NVIDIA 0x10de diff --git a/hwaccess.h b/hwaccess.h index 46335f38c..e5edcfa96 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -20,23 +20,6 @@ #ifndef __HWACCESS_H__ #define __HWACCESS_H__ 1 -#if NEED_PCI == 1 -/* - * libpci headers use the variable name "index" which triggers shadowing - * warnings on systems which have the index() function in a default #include - * or as builtin. - */ -#define index shadow_workaround_index - -#if !defined (__NetBSD__) -#include <pci/pci.h> -#else -#include <pciutils/pci.h> -#endif - -#undef index -#endif /* NEED_PCI == 1 */ - void mmio_writeb(uint8_t val, void *addr); void mmio_writew(uint16_t val, void *addr); void mmio_writel(uint32_t val, void *addr); diff --git a/internal.c b/internal.c index 43bed9e2a..4a8e27b23 100644 --- a/internal.c +++ b/internal.c @@ -20,6 +20,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" int is_laptop = 0; int laptop_ok = 0; @@ -18,6 +18,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" static uint8_t *it8212_bar = NULL; diff --git a/mcp6x_spi.c b/mcp6x_spi.c index 29d26634b..242934658 100644 --- a/mcp6x_spi.c +++ b/mcp6x_spi.c @@ -24,6 +24,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" /* Bit positions for each pin. */ @@ -18,6 +18,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define BIOS_ROM_ADDR 0x04 #define BIOS_ROM_DATA 0x08 diff --git a/nicintel.c b/nicintel.c index c5b9012ba..1730ca463 100644 --- a/nicintel.c +++ b/nicintel.c @@ -19,6 +19,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" static uint8_t *nicintel_bar; static uint8_t *nicintel_control_bar; diff --git a/nicintel_eeprom.c b/nicintel_eeprom.c index 58870732c..ab7534349 100644 --- a/nicintel_eeprom.c +++ b/nicintel_eeprom.c @@ -35,6 +35,7 @@ #include "spi.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_INTEL 0x8086 #define MEMMAP_SIZE 0x1c /* Only EEC, EERD and EEWR are needed. */ diff --git a/nicintel_spi.c b/nicintel_spi.c index 5dcdf7dde..f1ed12941 100644 --- a/nicintel_spi.c +++ b/nicintel_spi.c @@ -35,6 +35,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_INTEL 0x8086 #define MEMMAP_SIZE getpagesize() diff --git a/nicnatsemi.c b/nicnatsemi.c index 621672817..9dd39158f 100644 --- a/nicnatsemi.c +++ b/nicnatsemi.c @@ -18,6 +18,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_NATSEMI 0x100b diff --git a/nicrealtek.c b/nicrealtek.c index 70daeec06..0bf60fd2d 100644 --- a/nicrealtek.c +++ b/nicrealtek.c @@ -18,6 +18,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_REALTEK 0x10ec #define PCI_VENDOR_ID_SMC1211 0x1113 @@ -19,6 +19,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_OGP 0x1227 @@ -19,7 +19,7 @@ #include <string.h> #include "flash.h" #include "programmer.h" -#include "hwaccess.h" +#include "platform/pci.h" struct pci_access *pacc; diff --git a/platform/pci.h b/platform/pci.h new file mode 100644 index 000000000..f63529b73 --- /dev/null +++ b/platform/pci.h @@ -0,0 +1,25 @@ +/* + * This is a wrapper for libpci. + * ... + */ + + +#ifndef __PLATFORM_PCI_H__ +#define __PLATFORM_PCI_H__ + +/* + * An old libpci version seems to use the variable name "index" which triggers + * shadowing warnings on systems which have the index() function in a default + * #include or as builtin. + */ +#define index shadow_workaround_index + +#if defined (__NetBSD__) +#include <pciutils/pci.h> +#else +#include <pci/pci.h> +#endif + +#undef index + +#endif /* __PLATFORM_PCI_H__ */
\ No newline at end of file @@ -20,6 +20,7 @@ #include "flash.h" #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" static uint8_t *mv_bar; static uint16_t mv_iobar; @@ -18,6 +18,7 @@ #include "programmer.h" #include "hwaccess.h" +#include "platform/pci.h" #define PCI_VENDOR_ID_SII 0x1095 diff --git a/sb600spi.c b/sb600spi.c index d5e228c1d..92fcc8109 100644 --- a/sb600spi.c +++ b/sb600spi.c @@ -24,6 +24,7 @@ #include "programmer.h" #include "hwaccess.h" #include "spi.h" +#include "platform/pci.h" /* This struct is unused, but helps visualize the SB600 SPI BAR layout. *struct sb600_spi_controller { |