aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-03-25 08:55:21 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-05-15 13:38:47 +0200
commit2abf972ab60dd0e222722647aa4ed7abe257e874 (patch)
tree7501b2aa393f2e562d044df832c805ab95c62a32 /src
parent63565246a655ffe9d123d17838de5ba6e21dd173 (diff)
downloadseabios-hppa-2abf972ab60dd0e222722647aa4ed7abe257e874.zip
seabios-hppa-2abf972ab60dd0e222722647aa4ed7abe257e874.tar.gz
seabios-hppa-2abf972ab60dd0e222722647aa4ed7abe257e874.tar.bz2
acpi: add xsdt support
In case a xsdt table is present (and located below 4G) prefer it over rsdt. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/fw/biostables.c40
-rw-r--r--src/std/acpi.h11
2 files changed, 41 insertions, 10 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index fe8626e..0d4fdb9 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -141,18 +141,38 @@ find_acpi_table(u32 signature)
if (!RsdpAddr || RsdpAddr->signature != RSDP_SIGNATURE)
return NULL;
struct rsdt_descriptor_rev1 *rsdt = (void*)RsdpAddr->rsdt_physical_address;
+ struct xsdt_descriptor_rev2 *xsdt =
+ RsdpAddr->xsdt_physical_address >= 0x100000000
+ ? NULL : (void*)(u32)(RsdpAddr->xsdt_physical_address);
dprintf(4, "rsdt=%p\n", rsdt);
- if (!rsdt || rsdt->signature != RSDT_SIGNATURE)
- return NULL;
- void *end = (void*)rsdt + rsdt->length;
- int i;
- for (i=0; (void*)&rsdt->table_offset_entry[i] < end; i++) {
- struct acpi_table_header *tbl = (void*)rsdt->table_offset_entry[i];
- if (!tbl || tbl->signature != signature)
- continue;
- dprintf(4, "table(%x)=%p\n", signature, tbl);
- return tbl;
+ dprintf(4, "xsdt=%p\n", xsdt);
+
+ if (xsdt && xsdt->signature == XSDT_SIGNATURE) {
+ void *end = (void*)xsdt + xsdt->length;
+ int i;
+ for (i=0; (void*)&xsdt->table_offset_entry[i] < end; i++) {
+ if (xsdt->table_offset_entry[i] >= 0x100000000)
+ continue; /* above 4G */
+ struct acpi_table_header *tbl = (void*)(u32)xsdt->table_offset_entry[i];
+ if (!tbl || tbl->signature != signature)
+ continue;
+ dprintf(1, "table(%x)=%p (via xsdt)\n", signature, tbl);
+ return tbl;
+ }
+ }
+
+ if (rsdt && rsdt->signature == RSDT_SIGNATURE) {
+ void *end = (void*)rsdt + rsdt->length;
+ int i;
+ for (i=0; (void*)&rsdt->table_offset_entry[i] < end; i++) {
+ struct acpi_table_header *tbl = (void*)rsdt->table_offset_entry[i];
+ if (!tbl || tbl->signature != signature)
+ continue;
+ dprintf(1, "table(%x)=%p (via rsdt)\n", signature, tbl);
+ return tbl;
+ }
}
+
dprintf(4, "no table %x found\n", signature);
return NULL;
}
diff --git a/src/std/acpi.h b/src/std/acpi.h
index c01fa7b..81c2275 100644
--- a/src/std/acpi.h
+++ b/src/std/acpi.h
@@ -133,6 +133,17 @@ struct rsdt_descriptor_rev1
} PACKED;
/*
+ * ACPI 2.0 eXtended System Description Table (XSDT)
+ */
+#define XSDT_SIGNATURE 0x54445358 // XSDT
+struct xsdt_descriptor_rev2
+{
+ ACPI_TABLE_HEADER_DEF /* ACPI common table header */
+ u64 table_offset_entry[0]; /* Array of pointers to other */
+ /* ACPI tables */
+} PACKED;
+
+/*
* ACPI 1.0 Firmware ACPI Control Structure (FACS)
*/
#define FACS_SIGNATURE 0x53434146 // FACS