|
PatchworkOS
|
PCI configuration space. More...
Data Structures | |
| struct | pci_config_bar_t |
| PCI-e Configuration Space Base Address Allocation Structure. More... | |
| struct | mcfg_t |
| PCI Express Memory-mapped Configuration. More... | |
Typedefs | |
| typedef uint16_t | pci_segment_group_t |
| PCI Segment Group Type. | |
| typedef uint8_t | pci_bus_t |
| PCI Bus Type. | |
| typedef uint8_t | pci_slot_t |
| PCI Slot Type. | |
| typedef uint8_t | pci_function_t |
| PCI Function Type. | |
Functions | |
| 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 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.
PCI Bus Type.
Definition at line 29 of file pci_config.h.
| typedef uint8_t pci_function_t |
PCI Function Type.
Definition at line 39 of file pci_config.h.
| typedef uint16_t pci_segment_group_t |
PCI Segment Group Type.
Definition at line 24 of file pci_config.h.
| typedef uint8_t pci_slot_t |
PCI Slot Type.
Definition at line 34 of file pci_config.h.
| 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.
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
Definition at line 91 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_read().
| 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.
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
Definition at line 102 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_read().
| 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.
| segmentGroup | Segment group number |
| bus | Bus number |
| slot | Slot number |
| function | Function number |
| offset | Offset within the configuration space |
Definition at line 80 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_read().
| 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.
| 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 123 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_write().
| 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.
| 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 133 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_write().
| 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.
| 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 113 of file pci_config.c.
References NULL, and pci_config_get_address().
Referenced by aml_pci_config_write().