diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-06-30 04:42:29 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-06-30 04:42:29 +0000 |
commit | 1a26ea7f2ced9016ab13191dd6a7301a6255596c (patch) | |
tree | 8a832cc3ca2ad23ae8699b1eb1c736f70fe921af | |
parent | bcc2d4d520e31ba9f1905bca5afcf73520816b71 (diff) | |
download | src-1a26ea7f2ced9016ab13191dd6a7301a6255596c.tar.gz src-1a26ea7f2ced9016ab13191dd6a7301a6255596c.zip |
Add machdep quirks functions. On i386, this disables acpi on systems with
BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.
Notes
Notes:
svn path=/head/; revision=131312
-rw-r--r-- | sys/amd64/acpica/acpi_machdep.c | 6 | ||||
-rw-r--r-- | sys/dev/acpica/acpivar.h | 6 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_machdep.c | 24 | ||||
-rw-r--r-- | sys/ia64/acpica/acpi_machdep.c | 6 |
4 files changed, 42 insertions, 0 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index ee9deb34b6a4..a418b7195045 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -56,3 +56,9 @@ acpi_SetDefaultIntrModel(int model) intr_model = model; } + +int +acpi_machdep_quirks(int *quirks) +{ + return (0); +} diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index b3da30798511..41c424c4fa76 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -141,6 +141,10 @@ struct acpi_prw_data { #define ACPI_INTR_APIC 1 #define ACPI_INTR_SAPIC 2 +/* Quirk flags. */ +#define ACPI_Q_OK 0 +#define ACPI_Q_BROKEN (1 << 0) /* Disable ACPI completely. */ + /* * Note that the low ivar values are reserved to provide * interface compatibility with ISA drivers which can also @@ -321,6 +325,8 @@ int acpi_disabled(char *subsys); int acpi_machdep_init(device_t dev); void acpi_install_wakeup_handler(struct acpi_softc *sc); int acpi_sleep_machdep(struct acpi_softc *sc, int state); +int acpi_table_quirks(int *quirks); +int acpi_machdep_quirks(int *quirks); /* Battery Abstraction. */ struct acpi_battinfo; diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index e83c96ebeb38..9e8a35822d7f 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/sysctl.h> #include <sys/uio.h> +#include <vm/vm.h> +#include <vm/pmap.h> #include "acpi.h" #include <dev/acpica/acpivar.h> @@ -330,3 +332,25 @@ acpi_SetDefaultIntrModel(int model) intr_model = model; } + +/* Check BIOS date. If 1998 or older, disable ACPI. */ +int +acpi_machdep_quirks(int *quirks) +{ + char *va; + int year; + + /* BIOS address 0xffff5 contains the date in the format mm/dd/yy. */ + va = pmap_mapdev(0xffff0, 16); + sscanf(va + 11, "%2d", &year); + pmap_unmapdev((vm_offset_t)va, 16); + + /* + * Date must be >= 1/1/1999 or we don't trust ACPI. Note that this + * check must be changed by my 114th birthday. + */ + if (year > 90 && year < 99) + *quirks = ACPI_Q_BROKEN; + + return (0); +} diff --git a/sys/ia64/acpica/acpi_machdep.c b/sys/ia64/acpica/acpi_machdep.c index 5882396f8d26..238975048d9a 100644 --- a/sys/ia64/acpica/acpi_machdep.c +++ b/sys/ia64/acpica/acpi_machdep.c @@ -43,3 +43,9 @@ acpi_machdep_init(device_t dev) return (0); } + +int +acpi_machdep_quirks(int *quirks) +{ + return (0); +} |