summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>2008-01-15 22:22:27 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>2008-01-15 22:22:27 +0000
commit35a801ffe94f0838a493bd0b9a9298987cbf3b91 (patch)
treeed4a44490d04a8778bc7de6934b1c991cd991928 /sys
parent301314a981bd46fd1503bb61af86bcf97082f152 (diff)
Work around an intel BIOS bug where it locates the ACPI tables in
a region of memory marked free for use by the OS. Ok beck@, kettenis@, and --ok && ++!!ok tedu@.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/machdep.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 0bda082ae28..4554b068d9f 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.415 2008/01/13 14:03:21 mikeb Exp $ */
+/* $OpenBSD: machdep.c,v 1.416 2008/01/15 22:22:26 weingart Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2997,13 +2997,28 @@ init386(paddr_t first_avail)
if (a < 8 * NBPG)
a = 8 * NBPG;
- /* skip shorter than page regions */
- if (a >= e || (e - a) < NBPG) {
+ /* skip regions which are zero or negative in size */
+ if (a >= e) {
#ifdef DEBUG
printf("-S");
#endif
continue;
}
+
+ /*
+ * XXX - This is a hack to work around BIOS bugs and
+ * a bug in the msgbuf allocation. We skip regions
+ * smaller than the message buffer or 16-bit segment
+ * limit in size.
+ */
+ if ((e - a) < max((MSGBUFSIZE / NBPG), (64 * 1024))) {
+#ifdef DEBUG
+ printf("-X");
+#endif
+ continue;
+ }
+
+ /* skip legacy IO region */
if ((a > IOM_BEGIN && a < IOM_END) ||
(e > IOM_BEGIN && e < IOM_END)) {
#ifdef DEBUG