WIP: get PCI config base address from MCFG table

This commit is contained in:
Antoine Cure 2020-02-10 02:26:55 +01:00
parent 44781b1eaa
commit ee3ad3b3fa
2 changed files with 20 additions and 1 deletions

View File

@ -196,6 +196,23 @@ struct FADT_t
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
struct SDT_MCFG_t {
char signature[4];
uint length;
uchar revision;
uchar checksum;
char OEMID[6];
char OEMTableID[8];
uint OEMRevision;
uint creatorID;
uint creatorRevision;
uint sdtEntry;
ulong PCIConfigBaseAddress;
};
//----------------------------------------------------------------------------//
void IoInitAcpi(void); void IoInitAcpi(void);
SDTHeader_t *IoGetAcpiTable(ulong id); SDTHeader_t *IoGetAcpiTable(ulong id);

View File

@ -29,8 +29,10 @@
void pciGetDevice(ushort vendorID, ushort deviceID, int deviceType) void pciGetDevice(ushort vendorID, ushort deviceID, int deviceType)
{ {
if(IoGetAcpiTable(SDT_MCFG) == NULL) struct SDT_MCFG_t *MCFG_table = (struct SDT_MCFG_t*)IoGetAcpiTable(SDT_MCFG);
if(MCFG_table == NULL)
{ {
KernLog("Unable to access PCI configuration : MCFG table not reachable\n"); KernLog("Unable to access PCI configuration : MCFG table not reachable\n");
} }
KernLog("PCI Config Base address = %ld", MCFG_table->PCIConfigBaseAddress);
} }