diff options
author | njl <njl@FreeBSD.org> | 2004-03-04 04:42:59 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-03-04 04:42:59 +0000 |
commit | 2b5556f4cf850806c9b7c36ce854bb1b76c6c8d9 (patch) | |
tree | 74b71db5d5c733699c2d2f9c1b8b6b1e9cdd57f5 | |
parent | 9edf7709555b649f2b72add5b6d4eaa4e3c546e0 (diff) | |
download | FreeBSD-src-2b5556f4cf850806c9b7c36ce854bb1b76c6c8d9.zip FreeBSD-src-2b5556f4cf850806c9b7c36ce854bb1b76c6c8d9.tar.gz |
Add a "quirks" value to disable quirks handling for a given boot.
Also, disable quirks if booting with a custom DSDT. Add a quirk
to disable loading ACPI so known bad systems can be completely
blacklisted.
-rw-r--r-- | share/man/man4/acpi.4 | 5 | ||||
-rw-r--r-- | sys/dev/acpica/acpi.c | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index dda7368..1a08c94 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -266,6 +266,11 @@ typically as a child of a PCI bus. .Pq Vt device Supports an ACPI laptop lid switch, which typically puts a system to sleep. +.It Li quirks +.Pq Vt feature +Don't honor quirks. +Quirks automatically disable ACPI functionality based on the XSDT table's +OEM vendor name and revision date. .It Li pci .Pq Vt device Supports Host to PCI bridges. diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 29acd7e..c35faef 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -262,6 +262,8 @@ acpi_Startup(void) /* Set up any quirks we have for this XSDT. */ acpi_quirks_set(); + if (acpi_disabled("acpi")) + return_VALUE (AE_ERROR); return_VALUE (AE_OK); } @@ -283,9 +285,6 @@ acpi_identify(driver_t *driver, device_t parent) if (resource_disabled("acpi", 0)) return_VOID; - snprintf(acpi_ca_version, sizeof(acpi_ca_version), "0x%x", - ACPI_CA_VERSION); - /* Make sure we're not being doubly invoked. */ if (device_find_child(parent, "acpi", 0) != NULL) return_VOID; @@ -294,6 +293,8 @@ acpi_identify(driver_t *driver, device_t parent) if (ACPI_FAILURE(acpi_Startup())) return_VOID; + snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%#x", ACPI_CA_VERSION); + /* Attach the actual ACPI device. */ if ((child = BUS_ADD_CHILD(parent, 0, "acpi", 0)) == NULL) { device_printf(parent, "ACPI: could not attach\n"); @@ -583,10 +584,19 @@ acpi_quirks_set() char *env, *tmp; int len; - /* If the user specifies "noquirks", leave the settings alone. */ + /* + * If the user loaded a custom table or disabled "quirks", leave + * the settings alone. + */ len = 0; + if ((env = getenv("acpi_dsdt_load")) != NULL) { + /* XXX No strcasecmp but this is good enough. */ + if (*env == 'Y' || *env == 'y') + goto out; + freeenv(env); + } if ((env = getenv("debug.acpi.disabled")) != NULL) { - if (strstr("noquirks", env) != NULL) + if (strstr("quirks", env) != NULL) goto out; len = strlen(env); } |