It appears that the DSDT is indeed in the FADT. This means that my "obvious/trivial" implementation for laihost_scan() doesn't work. My implementation needs to know to look for the DSDT behind the FADT. Interesting.
Here is what I have:
Code:
template <typename T>
static void* laihost_scan(const T& rootTable, std::string_view signature, int index)
{
int count = 0;
for (auto address : rootTable)
{
const auto table = (acpi::Table*)(laihost_map(address, sizeof(acpi::Table)));
MTL_LOG(Debug) << "ACPI Table: " << table->GetSignature();
if (table->GetSignature() == signature)
{
if (index == count)
{
laihost_map(address, table->length); // TODO: is this required? can we do better?
return table;
}
++count;
}
}
return nullptr;
}
void* laihost_scan(const char* signature, size_t index)
{
if (g_xsdt)
return laihost_scan(*g_xsdt, signature, index);
else
return laihost_scan(*g_rsdt, signature, index);
}
I need to update this code to check for 'DSDT' and look inside the FADT instead of naively looping the XSDT.
I'll give this a try, thanks!