From 2b5556f4cf850806c9b7c36ce854bb1b76c6c8d9 Mon Sep 17 00:00:00 2001 From: njl Date: Thu, 4 Mar 2004 04:42:59 +0000 Subject: 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. --- sys/dev/acpica/acpi.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'sys/dev/acpica') 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); } -- cgit v1.1