Now detecting FADT

This commit is contained in:
Adrien Bourmault 2020-02-06 08:59:34 +01:00
parent 61c05c2fb1
commit 2d7da323ec
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)
{
SDTHeader *xrsdt = AcpiSDT;
SDTHeader *cur = NULL;
SDTHeader *table = NULL;
uint *curInt = NULL;
ulong *curLong = NULL;
register char checksum;
int entries;
if (IoACPIVersion == 1)
if (IoACPIVersion == 1) {
entries = (xrsdt->length - sizeof(xrsdt)) / 4;
else
} else {
entries = (xrsdt->length - sizeof(xrsdt)) / 8;
}
KernLog("\tACPI detected %d entries\n", entries);
curInt = &(xrsdt->sdtTablePtr);
curLong = &(xrsdt->sdtTablePtr);
for (int i = 0; i < entries; i++) {
cur = (SDTHeader *)((ulong)(xrsdt->sdtTablePtr));
table = &cur[i];
if (IoACPIVersion == 1)
table = (SDTHeader *)curInt[i];
else
table = (SDTHeader *)curLong[i];
// Checksum calculation
//checksum = DoChecksum(table, (size_t)table->length, 0, 0);
//KernLog("Checksum : %d\n", (int)checksum);
KernLog("\tACPI System Table id %s [%p]\n", table->signature, table);
//KernLog("\tACPI RSDT[%d] %p\n", i, table);
if (MmIsBusyZone(table)) {
checksum = DoChecksum(table, (size_t)table->length, 0, 0);
if (!checksum) {
KernLog("\tACPI System Table %s (OEM %s) length %d [%p]\n",
table->signature,
table->OEMID,
table->length,
table);
}
}
}
}