1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00

Now detecting FADT

This commit is contained in:
Adrien Bourmault 2020-02-06 08:59:34 +01:00
parent 61c05c2fb1
commit 2d7da323ec

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);
}
}
}
}