romcc_io: add pci_or_configX functions.

Some of the modules use their own rolled pci_or_configX functions.
Therefore, make them first class so everyone can use them without
copying them.

Change-Id: I9a4d3364c832548dbfe18139c27cce2d60c3316d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/1797
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Aaron Durbin 2012-10-31 21:46:35 -05:00 committed by Ronald G. Minnich
parent f75dd09a7f
commit a5b7067638
1 changed files with 15 additions and 0 deletions

View File

@ -244,6 +244,21 @@ static inline __attribute__((always_inline)) void pci_write_config32(device_t de
#endif #endif
} }
static inline __attribute__((always_inline)) void pci_or_config8(device_t dev, unsigned where, uint8_t value)
{
pci_write_config8(dev, where, pci_read_config8(dev, where) | value);
}
static inline __attribute__((always_inline)) void pci_or_config16(device_t dev, unsigned where, uint16_t value)
{
pci_write_config16(dev, where, pci_read_config16(dev, where) | value);
}
static inline __attribute__((always_inline)) void pci_or_config32(device_t dev, unsigned where, uint32_t value)
{
pci_write_config32(dev, where, pci_read_config32(dev, where) | value);
}
#define PCI_DEV_INVALID (0xffffffffU) #define PCI_DEV_INVALID (0xffffffffU)
static inline device_t pci_io_locate_device(unsigned pci_id, device_t dev) static inline device_t pci_io_locate_device(unsigned pci_id, device_t dev)
{ {