From bd0616e6e76d5b56414a6c77131a9bb63cf5e985 Mon Sep 17 00:00:00 2001 From: Aleksa Vuckovic Date: Mon, 6 Mar 2023 01:59:33 +0100 Subject: parsing pcie MCFG table --- kernel/include/mcfg.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 kernel/include/mcfg.h (limited to 'kernel/include/mcfg.h') diff --git a/kernel/include/mcfg.h b/kernel/include/mcfg.h new file mode 100644 index 0000000..9f062c0 --- /dev/null +++ b/kernel/include/mcfg.h @@ -0,0 +1,31 @@ +#ifndef MCFG_H +#define MCFG_H + +#include + +struct config_space_mcfgt { + uint64_t base_addr; + uint16_t pci_seg_group; + uint8_t start_pci_bus; + uint8_t end_pci_bus; + uint32_t reserved; +} __attribute__((packed)); +typedef struct config_space_mcfgt config_space_mcfgt; + +struct MCFGT { + uint32_t signature; + uint32_t length; + uint8_t revision; + uint8_t checksum; + uint8_t oem_id[6]; + uint64_t oem_table_id; + uint32_t oem_table_revision; + uint32_t creator_id; + uint32_t creator_revision; + uint64_t reserved; +} __attribute__((packed)); +typedef struct MCFGT MCFGT; + +void read_mcfgt(void); + +#endif -- cgit v1.2.3