7 typedef uint32_t pciaddr_t;
9 static inline pciaddr_t pci_mkaddr(uint32_t bus, uint32_t dev,
10 uint32_t func, uint32_t reg)
12 return 0x80000000 | ((bus & 0xff) << 16) | ((dev & 0x1f) << 11) |
13 ((func & 0x07) << 8) | (reg & 0xff);
16 enum pci_config_type {
17 PCI_CFG_AUTO = 0, /* autodetect */
22 void pci_set_config_type(enum pci_config_type);
24 uint8_t pci_readb(pciaddr_t);
25 uint16_t pci_readw(pciaddr_t);
26 uint32_t pci_readl(pciaddr_t);
27 void pci_writeb(uint8_t, pciaddr_t);
28 void pci_writew(uint16_t, pciaddr_t);
29 void pci_writel(uint32_t, pciaddr_t);
31 #endif /* _SYS_PCI_H */