Add test to match struct device with pci_devfn_t
Add a function to test if pci_devfn_t matches with a device instance of struct device, by comparing bus:dev.fn. Change-Id: Ic6c3148ac62c7183246d83302ee504b17064c794 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3474 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user