summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2000-12-17 21:10:32 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2000-12-17 21:10:32 +0000
commit06dfc172b936c807d2bd242ca4fd24125ba151bd (patch)
tree6f7010c76cc1531b47fc4a79d56d775bb90ab39a /sys/arch/i386
parent40a4efcd8b7e1f72d00055809e7694003a84a876 (diff)
Add a new possible value for the machdep.allowaperture sysctl: `2'
allows access to the whole 1st megabyte of memory, for use by XFree86 4.0.x int10 code. (ok, deraadt@) CVS: ---------------------------------------------------------------------- sys/arch/i386/i386/mem.c share/man/man4/man4.i386/xf86.4 CVS: ----------------------------------------------------------------------
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/mem.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index f9c74f05c08..597f966112c 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,5 +1,5 @@
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.14 1999/11/20 11:11:28 matthieu Exp $ */
+/* $OpenBSD: mem.c,v 1.15 2000/12/17 21:10:31 matthieu Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -268,12 +268,26 @@ mmmmap(dev, off, prot)
#ifdef APERTURE
/* minor device 4 is aperture driver */
case 4:
- if (allowaperture &&
- (((off >= VGA_START && off <= BIOS_END) ||
- (unsigned)off > (unsigned)ctob(physmem))))
- return i386_btop(off);
- else
+ switch (allowaperture) {
+ case 1:
+ /* Allow mapping of the VGA framebuffer & BIOS only */
+ if ((off >= VGA_START && off <= BIOS_END) ||
+ (unsigned)off > (unsigned)ctob(physmem))
+ return i386_btop(off);
+ else
+ return -1;
+ case 2:
+ /* Allow mapping of the whole 1st megabyte
+ for x86emu */
+ if (off <= BIOS_END ||
+ (unsigned)off > (unsigned)ctob(physmem))
+ return i386_btop(off);
+ else
+ return -1;
+ default:
return -1;
+ }
+
#endif
default:
return -1;