summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica/acpi_machdep.c
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/i386/acpica/acpi_machdep.c
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/i386/acpica/acpi_machdep.c')
-rw-r--r--sys/i386/acpica/acpi_machdep.c24
1 files changed, 24 insertions, 0 deletions
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);
+}
OpenPOWER on IntegriCloud