12 #include <config/ioapi.h>
15 * Calculate static inline PCI I/O API function name
17 * @v _prefix Subsystem prefix
18 * @v _api_func API function
19 * @ret _subsys_func Subsystem API function
21 #define PCIAPI_INLINE( _subsys, _api_func ) \
22 SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
25 * Provide a PCI I/O API implementation
27 * @v _prefix Subsystem prefix
28 * @v _api_func API function
29 * @v _func Implementing function
31 #define PROVIDE_PCIAPI( _subsys, _api_func, _func ) \
32 PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func )
35 * Provide a static inline PCI I/O API implementation
37 * @v _prefix Subsystem prefix
38 * @v _api_func API function
40 #define PROVIDE_PCIAPI_INLINE( _subsys, _api_func ) \
41 PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
43 /* Include all architecture-independent I/O API headers */
45 /* Include all architecture-dependent I/O API headers */
46 #include <bits/pci_io.h>
49 * Determine maximum PCI bus number within system
51 * @ret max_bus Maximum bus number
53 int pci_max_bus ( void );
56 * Read byte from PCI configuration space
59 * @v where Location within PCI configuration space
61 * @ret rc Return status code
63 int pci_read_config_byte ( struct pci_device *pci, unsigned int where,
67 * Read 16-bit word from PCI configuration space
70 * @v where Location within PCI configuration space
72 * @ret rc Return status code
74 int pci_read_config_word ( struct pci_device *pci, unsigned int where,
78 * Read 32-bit dword from PCI configuration space
81 * @v where Location within PCI configuration space
83 * @ret rc Return status code
85 int pci_read_config_dword ( struct pci_device *pci, unsigned int where,
89 * Write byte to PCI configuration space
92 * @v where Location within PCI configuration space
93 * @v value Value to be written
94 * @ret rc Return status code
96 int pci_write_config_byte ( struct pci_device *pci, unsigned int where,
100 * Write 16-bit word to PCI configuration space
103 * @v where Location within PCI configuration space
104 * @v value Value to be written
105 * @ret rc Return status code
107 int pci_write_config_word ( struct pci_device *pci, unsigned int where,
111 * Write 32-bit dword to PCI configuration space
114 * @v where Location within PCI configuration space
115 * @v value Value to be written
116 * @ret rc Return status code
118 int pci_write_config_dword ( struct pci_device *pci, unsigned int where,
121 #endif /* _GPXE_PCI_IO_H */