aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-02-05 21:16:39 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-02-05 21:16:39 -0500
commit423a04d6c244e6126b1e49285181e59bd0c196fb (patch)
tree3efca64199d13867cad1fe4e0601a5e0905686e7 /src
parent0afee5259efc532c6000231bcb25ce7b1e355bc8 (diff)
downloadseabios-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pci.h b/src/pci.h
index ab7cb9e..81ac629 100644
--- a/src/pci.h
+++ b/src/pci.h
@@ -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);