8 * PCI configuration space access via PCI BIOS
14 #define PCIBIOS_INSTALLATION_CHECK 0xb1010000
15 #define PCIBIOS_READ_CONFIG_BYTE 0xb1080000
16 #define PCIBIOS_READ_CONFIG_WORD 0xb1090000
17 #define PCIBIOS_READ_CONFIG_DWORD 0xb10a0000
18 #define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b0000
19 #define PCIBIOS_WRITE_CONFIG_WORD 0xb10c0000
20 #define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d0000
22 extern int pcibios_max_bus ( void );
23 extern int pcibios_read ( struct pci_device *pci, uint32_t command,
25 extern int pcibios_write ( struct pci_device *pci, uint32_t command,
29 * Read byte from PCI configuration space via PCI BIOS
32 * @v where Location within PCI configuration space
34 * @ret rc Return status code
36 static inline __attribute__ (( always_inline )) int
37 pcibios_read_config_byte ( struct pci_device *pci, unsigned int where,
42 rc = pcibios_read ( pci, PCIBIOS_READ_CONFIG_BYTE | where, &tmp );
48 * Read word from PCI configuration space via PCI BIOS
51 * @v where Location within PCI configuration space
53 * @ret rc Return status code
55 static inline __attribute__ (( always_inline )) int
56 pcibios_read_config_word ( struct pci_device *pci, unsigned int where,
61 rc = pcibios_read ( pci, PCIBIOS_READ_CONFIG_WORD | where, &tmp );
67 * Read dword from PCI configuration space via PCI BIOS
70 * @v where Location within PCI configuration space
72 * @ret rc Return status code
74 static inline __attribute__ (( always_inline )) int
75 pcibios_read_config_dword ( struct pci_device *pci, unsigned int where,
77 return pcibios_read ( pci, PCIBIOS_READ_CONFIG_DWORD | where, value );
81 * Write byte to PCI configuration space via PCI BIOS
84 * @v where Location within PCI configuration space
85 * @v value Value to be written
86 * @ret rc Return status code
88 static inline __attribute__ (( always_inline )) int
89 pcibios_write_config_byte ( struct pci_device *pci, unsigned int where,
91 return pcibios_write ( pci, PCIBIOS_WRITE_CONFIG_BYTE | where, value );
95 * Write word to PCI configuration space via PCI BIOS
98 * @v where Location within PCI configuration space
99 * @v value Value to be written
100 * @ret rc Return status code
102 static inline __attribute__ (( always_inline )) int
103 pcibios_write_config_word ( struct pci_device *pci, unsigned int where,
105 return pcibios_write ( pci, PCIBIOS_WRITE_CONFIG_BYTE | where, value );
109 * Write dword to PCI configuration space via PCI BIOS
112 * @v where Location within PCI configuration space
113 * @v value Value to be written
114 * @ret rc Return status code
116 static inline __attribute__ (( always_inline )) int
117 pcibios_write_config_dword ( struct pci_device *pci, unsigned int where,
119 return pcibios_write ( pci, PCIBIOS_WRITE_CONFIG_BYTE | where, value );
122 #endif /* _PCIBIOS_H */