-/* $OpenBSD: mem.c,v 1.24 2015/05/28 20:53:05 jcs Exp $ */
+/* $OpenBSD: mem.c,v 1.25 2015/06/22 18:57:26 kettenis Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
#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 */
/* $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
#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 */
-/* $OpenBSD: memrange.h,v 1.8 2013/12/19 21:30:02 deraadt Exp $ */
+/* $OpenBSD: memrange.h,v 1.9 2015/06/22 18:57:26 kettenis Exp $ */
/*-
* Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
* All rights reserved.
#define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op)
#define MEMRANGE_SET _IOW('m', 51, struct mem_range_op)
+/* Offset indicating a write combining mapping is requested. */
+#define MEMRANGE_WC_RANGE 0x4000000000000000ULL
+
#ifdef _KERNEL
struct mem_range_softc;