25 LOG_ERR(
"no MCFG table found\n");
32 LOG_ERR(
"MCFG table does not contain a whole number of entries\n");
43 uint64_t length = busCount * 256 * 4096;
48 LOG_ERR(
"failed to map PCI-e configuration space at %p\n", entry->
base);
sdt_header_t * acpi_tables_lookup(const char *signature, uint64_t minSize, uint64_t n)
Lookup the n'th table matching the signature.
static uintptr_t address
Mapped virtual address of the HPET registers.
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, phys_addr_t physAddr, size_t length, pml_flags_t flags, space_callback_func_t func, void *data)
Maps physical memory to virtual memory in a given address space.
#define LOCK_CREATE()
Create a lock initializer.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
#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)
static uint64_t pci_config_init(void)
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
A simple ticket lock implementation.
PCI Express Memory-mapped Configuration.
pci_config_bar_t entries[]
PCI-e Configuration Space Base Address Allocation Structure.
pci_segment_group_t segmentGroup