Now detecting FADT

This commit is contained in:
Adrien Bourmault 2020-02-06 08:59:34 +01:00
parent 28e1a4278d
commit 8603f22bcf
1 changed files with 23 additions and 11 deletions

View File

@ -175,29 +175,41 @@ static inline void IoInitRXSDT(void)
static inline void IoSearchAcpiTables(void) static inline void IoSearchAcpiTables(void)
{ {
SDTHeader *xrsdt = AcpiSDT; SDTHeader *xrsdt = AcpiSDT;
SDTHeader *cur = NULL;
SDTHeader *table = NULL; SDTHeader *table = NULL;
uint *curInt = NULL;
ulong *curLong = NULL;
register char checksum; register char checksum;
int entries; int entries;
if (IoACPIVersion == 1) if (IoACPIVersion == 1) {
entries = (xrsdt->length - sizeof(xrsdt)) / 4; entries = (xrsdt->length - sizeof(xrsdt)) / 4;
else } else {
entries = (xrsdt->length - sizeof(xrsdt)) / 8; entries = (xrsdt->length - sizeof(xrsdt)) / 8;
}
KernLog("\tACPI detected %d entries\n", entries); KernLog("\tACPI detected %d entries\n", entries);
curInt = &(xrsdt->sdtTablePtr);
curLong = &(xrsdt->sdtTablePtr);
for (int i = 0; i < entries; i++) { for (int i = 0; i < entries; i++) {
cur = (SDTHeader *)((ulong)(xrsdt->sdtTablePtr)); if (IoACPIVersion == 1)
table = &cur[i]; table = (SDTHeader *)curInt[i];
else
table = (SDTHeader *)curLong[i];
// Checksum calculation //KernLog("\tACPI RSDT[%d] %p\n", i, table);
//checksum = DoChecksum(table, (size_t)table->length, 0, 0); if (MmIsBusyZone(table)) {
checksum = DoChecksum(table, (size_t)table->length, 0, 0);
//KernLog("Checksum : %d\n", (int)checksum); if (!checksum) {
KernLog("\tACPI System Table %s (OEM %s) length %d [%p]\n",
KernLog("\tACPI System Table id %s [%p]\n", table->signature, table); table->signature,
table->OEMID,
table->length,
table);
}
}
} }
} }