summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-03-04 04:42:59 +0000
committernjl <njl@FreeBSD.org>2004-03-04 04:42:59 +0000
commit2b5556f4cf850806c9b7c36ce854bb1b76c6c8d9 (patch)
tree74b71db5d5c733699c2d2f9c1b8b6b1e9cdd57f5 /sys/dev/acpica
parent9edf7709555b649f2b72add5b6d4eaa4e3c546e0 (diff)
downloadFreeBSD-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.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi.c20
1 files changed, 15 insertions, 5 deletions
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);
}
OpenPOWER on IntegriCloud