diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-06-22 18:57:27 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-06-22 18:57:27 +0000 |
commit | 1846105a39682b697de44a3ef9a9949dcf027e31 (patch) | |
tree | c833e706aecf066b27a07f7ca599f461c6ac1763 /sys/arch/i386 | |
parent | b25f077a9359f739876ecddad42e647692465ec4 (diff) |
Make it possible to create write combing mappings through /dev/mem. This is
done by introducining a magic offset. Pages below this offset are mapped
with default memory attributes. Above this offset pages are mapped write
combining.
ok mlarkin@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/mem.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c index b45e8e04df3..d6cb3aa1879 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.44 2015/05/28 20:53:05 jcs Exp $ */ +/* $OpenBSD: mem.c,v 1.45 2015/06/22 18:57:26 kettenis Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 @@ -219,6 +219,10 @@ mmmmap(dev_t dev, off_t off, int prot) #ifdef APERTURE /* minor device 4 is aperture driver */ case 4: + /* Check if a write combining mapping is requested. */ + if (off >= MEMRANGE_WC_RANGE) + off = (off - MEMRANGE_WC_RANGE) | PMAP_WC; + switch (allowaperture) { case 1: /* Allow mapping of the VGA framebuffer & BIOS only */ |