aboutsummaryrefslogtreecommitdiff
path: root/src/include/device/pci_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/device/pci_def.h')
-rw-r--r--src/include/device/pci_def.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/device/pci_def.h b/src/include/device/pci_def.h
index ac20659f10..dae4e685b5 100644
--- a/src/include/device/pci_def.h
+++ b/src/include/device/pci_def.h
@@ -474,4 +474,8 @@
#define PCI_FUNC(devfn) ((devfn) & 0x07)
#define PCI_BDF(bus,dev,func) ((bus) << 16 | (dev) << 11 | (func) << 8)
+/* Translation from PCI_DEV() to devicetree bus and path.pci.devfn. */
+#define PCI_DEV2DEVFN(sdev) (((sdev)>>12) & 0xff)
+#define PCI_DEV2SEGBUS(sdev) (((sdev)>>20) & 0xfff)
+
#endif /* PCI_DEF_H */