17 LOG_ERR(
"MCFG table does not contain a whole number of entries\n");
28 uint64_t length = busCount * 256 * 4096;
34 LOG_ERR(
"failed to map PCI-e configuration space at 0x%016lx\n", entry->
base);
#define ACPI_SDT_HANDLER_REGISTER(sig, initHandler)
Macro to register an ACPI SDT handler.
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.
uint8_t pci_function_t
PCI Function Type.
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.
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.
uint8_t pci_slot_t
PCI Slot Type.
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_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.
uint8_t pci_bus_t
PCI Bus Type.
uint16_t pci_segment_group_t
PCI Segment Group Type.
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.
#define LOG_ERR(format,...)
#define LOG_INFO(format,...)
#define PML_LOWER_TO_HIGHER(addr)
Converts an address from the lower half to the higher half.
void * vmm_map(space_t *space, void *virtAddr, void *physAddr, uint64_t length, pml_flags_t flags, space_callback_func_t func, void *private)
Maps physical memory to virtual memory in a given address space.
#define errno
Error number variable.
#define NULL
Pointer error value.
#define ERR
Integer error value.
static volatile void * pci_config_get_address(pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, uint8_t function, uint16_t offset)
uint64_t pci_config_init(sdt_header_t *table)
static pci_config_bar_t * pci_config_bar_get(pci_segment_group_t segmentGroup, pci_bus_t bus)
static uint64_t entryCount
__UINTPTR_TYPE__ uintptr_t
PCI Express Memory-mapped Configuration.
pci_config_bar_t entries[]
PCI-e Configuration Space Base Address Allocation Structure.
pci_segment_group_t segmentGroup