summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-06-30 04:42:29 +0000
committernjl <njl@FreeBSD.org>2004-06-30 04:42:29 +0000
commit53a70792e9096e1fa022cf319d27bf15d6e708e1 (patch)
tree8a832cc3ca2ad23ae8699b1eb1c736f70fe921af /sys
parentdc22443bf3d78b6245f02a145e4224606b77eae5 (diff)
downloadFreeBSD-src-53a70792e9096e1fa022cf319d27bf15d6e708e1.zip
FreeBSD-src-53a70792e9096e1fa022cf319d27bf15d6e708e1.tar.gz
Add machdep quirks functions. On i386, this disables acpi on systems with
BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/acpica/acpi_machdep.c6
-rw-r--r--sys/dev/acpica/acpivar.h6
-rw-r--r--sys/i386/acpica/acpi_machdep.c24
-rw-r--r--sys/ia64/acpica/acpi_machdep.c6
4 files changed, 42 insertions, 0 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c
index ee9deb3..a418b71 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 b3da307..41c424c4f 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 e83c96e..9e8a358 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 5882396..2389750 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);
+}
OpenPOWER on IntegriCloud