PCI configuration space.
More...
PCI configuration space.
Id like to use the PCI Firmware Specification as a reference for this, but unfortunately, its not freely available. So we use the OSDev Wiki instead.
- See also
- OSDev PCI
-
OSDev PCI Express
|
| uint8_t | pci_config_read8 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset) |
| | Read a byte from PCI configuration space.
|
| |
| uint16_t | pci_config_read16 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset) |
| | Read a word from PCI configuration space.
|
| |
| uint32_t | pci_config_read32 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset) |
| | Read a dword from PCI configuration space.
|
| |
| void | pci_config_write8 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint8_t value) |
| | Write a byte to PCI configuration space.
|
| |
| void | pci_config_write16 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint16_t value) |
| | Write a word to PCI configuration space.
|
| |
| void | pci_config_write32 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint32_t value) |
| | Write a dword to PCI configuration space.
|
| |
◆ pci_segment_group_t
PCI Segment Group Type.
Definition at line 24 of file config.h.
◆ pci_bus_t
PCI Bus Type.
Definition at line 29 of file config.h.
◆ pci_slot_t
PCI Slot Type.
Definition at line 34 of file config.h.
◆ pci_function_t
PCI Function Type.
Definition at line 39 of file config.h.
◆ pci_config_read8()
Read a byte from PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
- Returns
- Byte read from the configuration space
Definition at line 103 of file config.c.
◆ pci_config_read16()
Read a word from PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
- Returns
- Word read from the configuration space
Definition at line 119 of file config.c.
◆ pci_config_read32()
Read a dword from PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
- Returns
- DWord read from the configuration space
Definition at line 135 of file config.c.
◆ pci_config_write8()
Write a byte to PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
| value | Byte value to write |
Definition at line 151 of file config.c.
◆ pci_config_write16()
Write a word to PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
| value | Word value to write |
Definition at line 161 of file config.c.
◆ pci_config_write32()
Write a dword to PCI configuration space.
- Parameters
-
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
| value | DWord value to write |
Definition at line 176 of file config.c.