acpi: Allow finding the RSDT or XSDT

At present acpi_find_table() support locating most of the tables, but
not these two, since they are the pointers to the rest.

When adding new tables, these tables need to be located and updated, so
update acpi_find_table() to allow searching for them.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-07-08 04:47:11 +02:00
parent 84dfe7f251
commit 34203312d0
2 changed files with 13 additions and 0 deletions

View File

@@ -121,6 +121,11 @@ struct acpi_table_header *acpi_find_table(const char *sig)
return NULL;
count = ret;
if (!strcmp("RSDT", sig))
return &rsdt->header;
if (!strcmp("XSDT", sig))
return &xsdt->header;
for (i = 0; i < count; i++) {
struct acpi_table_header *hdr;
@@ -204,6 +209,11 @@ int acpi_add_table(struct acpi_ctx *ctx, void *table)
struct acpi_rsdt *rsdt;
struct acpi_xsdt *xsdt;
if (!ctx->rsdt && !ctx->xsdt) {
log_err("ACPI: Error: no RSDT / XSDT\n");
return -EINVAL;
}
/* On legacy x86 platforms the RSDT is mandatory while the XSDT is not.
* On other platforms there might be no memory below 4GiB, thus RSDT is NULL.
*/