diff options
author | jkim <jkim@FreeBSD.org> | 2009-06-04 20:53:26 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-06-04 20:53:26 +0000 |
commit | ad2687086c4f379c1378279a2b338fc52e06048a (patch) | |
tree | 9b982ac6f16f01bd63dda008ee43676f93cd1ad3 /sys/dev | |
parent | 419d50d00de6d079fc426a14d51f3d8cec3a0abd (diff) | |
download | FreeBSD-src-ad2687086c4f379c1378279a2b338fc52e06048a.zip FreeBSD-src-ad2687086c4f379c1378279a2b338fc52e06048a.tar.gz |
Fix ACPI table override. Since ACPI CA 20090123, any ACPI table can be
overriden, not just DSDT. However, we do not support this feature yet.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpica/Osd/OsdTable.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c index 8d0965e..04de0b4 100644 --- a/sys/dev/acpica/Osd/OsdTable.c +++ b/sys/dev/acpica/Osd/OsdTable.c @@ -67,17 +67,30 @@ ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - caddr_t acpi_dsdt, p; + char modname[] = "acpi_dsdt"; + caddr_t acpi_table, p, s; if (ExistingTable == NULL || NewTable == NULL) return (AE_BAD_PARAMETER); +#ifdef notyet + for (int i = 0; i < ACPI_NAME_SIZE; i++) + modname[i + 5] = tolower(ExistingTable->Signature[i]); +#else /* If we're not overriding the DSDT, just return. */ - if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) == NULL || - (p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) == NULL) { + if (strncmp(ExistingTable->Signature, "DSDT", ACPI_NAME_SIZE) != 0) { *NewTable = NULL; - } else + return (AE_OK); + } +#endif + + if ((acpi_table = preload_search_by_type(modname)) != NULL && + (p = preload_search_info(acpi_table, MODINFO_ADDR)) != NULL && + (s = preload_search_info(acpi_table, MODINFO_SIZE)) != NULL && + *(size_t *)s != 0) *NewTable = *(ACPI_TABLE_HEADER **)p; + else + *NewTable = NULL; return (AE_OK); } |