diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-02-05 21:16:39 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-02-05 21:16:39 -0500 |
commit | 423a04d6c244e6126b1e49285181e59bd0c196fb (patch) | |
tree | 3efca64199d13867cad1fe4e0601a5e0905686e7 /src | |
parent | 0afee5259efc532c6000231bcb25ce7b1e355bc8 (diff) | |
download | seabios-hppa-423a04d6c244e6126b1e49285181e59bd0c196fb.zip seabios-hppa-423a04d6c244e6126b1e49285181e59bd0c196fb.tar.gz seabios-hppa-423a04d6c244e6126b1e49285181e59bd0c196fb.tar.bz2 |
Add pci_to_bdf() helper function.
This function is useful when setting the OPTIONROM_BDF_1/2 defs.
Diffstat (limited to 'src')
-rw-r--r-- | src/pci.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -15,6 +15,9 @@ static inline u8 pci_bdf_to_dev(u16 bdf) { static inline u8 pci_bdf_to_fn(u16 bdf) { return bdf & 0x07; } +static inline u16 pci_to_bdf(int bus, int dev, int fn) { + return (bus<<8) | (dev<<3) | fn; +} void pci_config_writel(u16 bdf, u32 addr, u32 val); void pci_config_writew(u16 bdf, u32 addr, u16 val); |