diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2009-04-14 13:45:33 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-04-15 16:23:56 -0700 |
commit | 00062572d3464571b4a7e7aafdf7eb2284059fe1 (patch) | |
tree | 17ecc73e4a0b6e839c2832d357376c4308d0f938 | |
parent | c0e760fdb7ce04a67f0c7f47535eb710bc5a6e7f (diff) | |
download | syslinux-00062572d3464571b4a7e7aafdf7eb2284059fe1.tar.gz |
pci: add pci_for_each_func3() which produces an address
Add pci_for_each_func3() iterator, which produces an address in
addition to the device pointer.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | com32/include/sys/pci.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h index 2e1871ed..b44db62f 100644 --- a/com32/include/sys/pci.h +++ b/com32/include/sys/pci.h @@ -80,6 +80,16 @@ struct pci_domain { if (((funcp) = (domain)->bus[__pci_bus]->slot[__pci_slot]-> \ func[__pci_func])) +#define for_each_pci_func3(funcp, domain, addr) \ + for (int __pci_bus = 0; __pci_bus < MAX_PCI_BUSES; __pci_bus++) \ + if ((domain)->bus[__pci_bus]) \ + for (int __pci_slot = 0; __pci_slot < MAX_PCI_DEVICES; __pci_slot++) \ + if ((domain)->bus[__pci_bus]->slot[__pci_slot]) \ + for (int __pci_func = 0; __pci_func < MAX_PCI_FUNC; __pci_func++) \ + if (((addr) = pci_mkaddr(__pci_bus, __pci_slot, __pci_func, 0)), \ + ((funcp) = (domain)->bus[__pci_bus]->slot[__pci_slot]-> \ + func[__pci_func])) + struct match { struct match *next; uint32_t did; |