51extern int pci_bus_count(
void);
56extern uint32_t pci_invalid_address;
60 PCI_CONFIG_LIB_NONE = 0,
61 PCI_CONFIG_LIB_AUTO = 1,
62 PCI_CONFIG_LIB_STATIC = 2,
63 PCI_CONFIG_LIB_READ = 3,
64 PCI_CONFIG_LIB_PERIPHERAL = 4,
66extern const int pci_config_lib_type;
73extern int (*pci_config_lib_init)(void);
74extern void (*pci_config_lib_register)(
void *
config);
81extern int pci_config_init(
void);
86extern void pci_config_register(
void *
config);
92extern void pci_cfg_print(
void);
102#define SEARCH_CHILDREN 0
103#define SEARCH_DEPTH 1
118extern int pci_for_each_child(
120 int (*func)(
struct pci_dev *,
void *arg),
136extern int pci_for_each_dev(
137 int (*func)(
struct pci_dev *,
void *arg),
147extern int pci_find_dev(uint16_t ven, uint16_t dev,
int index,
156extern int pci_get_dev(pci_dev_t pcidev,
struct pci_dev **ppdev);
160#define PCI_RES_MEMIO 2
161#define PCI_RES_MEM_PREFETCH 1
162#define PCI_RES_MEM (PCI_RES_MEMIO | PCI_RES_MEM_PREFETCH)
163#define PCI_RES_TYPE_MASK 0x3
164#define PCI_RES_IO32 0x08
165#define PCI_RES_FAIL 0x10
184#define RES2DEV(res) ((struct pci_dev *) \
185 ((uintptr_t)res - (uintptr_t)(res->bar * (sizeof(struct pci_res)))))
188#define PCI_DEV_BRIDGE 0x01
189#define PCI_DEV_RES_FAIL 0x02
192#define PCI_BUS_IO 0x01
193#define PCI_BUS_MEMIO 0x02
194#define PCI_BUS_MEM 0x04
195#define PCI_BUS_IO32 0x08
197#define BRIDGE_RES_COUNT 2
198#define BUS_RES_START BRIDGE_RES_COUNT
224 BRIDGE_RES_MEMIO = 3,
226 BRIDGE_RES_UNUSED1 = 5,
231#define DEV_RES_CNT (DEV_RES_ROM + 1)
235 struct pci_res resources[DEV_RES_CNT];
262#if defined(PCI_CFG_AUTO_LIB)
PCI Auto Configuration Library.
PCI Read Configuration Library.
Static PCI Auto Configuration Library.
Definition: deflate.c:114