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 */
44 #include <gpxe/efi/efi_pci.h>
46 /* Include all architecture-dependent I/O API headers */
47 #include <bits/pci_io.h>
50 * Determine maximum PCI bus number within system
52 * @ret max_bus Maximum bus number
54 int pci_max_bus ( void );
57 * Read byte from PCI configuration space
60 * @v where Location within PCI configuration space
62 * @ret rc Return status code
64 int pci_read_config_byte ( struct pci_device
*pci
, unsigned int where
,
68 * Read 16-bit word from PCI configuration space
71 * @v where Location within PCI configuration space
73 * @ret rc Return status code
75 int pci_read_config_word ( struct pci_device
*pci
, unsigned int where
,
79 * Read 32-bit dword from PCI configuration space
82 * @v where Location within PCI configuration space
84 * @ret rc Return status code
86 int pci_read_config_dword ( struct pci_device
*pci
, unsigned int where
,
90 * Write byte to PCI configuration space
93 * @v where Location within PCI configuration space
94 * @v value Value to be written
95 * @ret rc Return status code
97 int pci_write_config_byte ( struct pci_device
*pci
, unsigned int where
,
101 * Write 16-bit word to PCI configuration space
104 * @v where Location within PCI configuration space
105 * @v value Value to be written
106 * @ret rc Return status code
108 int pci_write_config_word ( struct pci_device
*pci
, unsigned int where
,
112 * Write 32-bit dword to PCI configuration space
115 * @v where Location within PCI configuration space
116 * @v value Value to be written
117 * @ret rc Return status code
119 int pci_write_config_dword ( struct pci_device
*pci
, unsigned int where
,
122 #endif /* _GPXE_PCI_IO_H */