summaryrefslogtreecommitdiff
path: root/sysutils/aperture/patches/patch-ad
blob: a7dec6c5f732943c522abc70568fadb8490b0d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-ad,v 1.6 2003/03/19 17:56:39 jmmv Exp $

--- module/aperture.c.orig	2003-03-19 18:52:51.000000000 +0100
+++ module/aperture.c
@@ -117,8 +117,17 @@ xf86close(dev, cflags, devtype, p)
  * allow only section in the vga framebuffer and above main memory 
  * to be mapped
  */
+/*
+ * Technically, the change to the kernel mmap interface happened
+ * during 1.5A, but after the interface changed, the kernel version
+ * was inexplicably not bumped.  Starting with 1.5B _and_ with the
+ * 1.5-branch releases, the change to the kernel mmap interface
+ * appears.
+ */
 #if !defined(__NetBSD_Version__) || \
-    (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105000000))
+    (defined(__NetBSD_Version__) && \
+     ((__NetBSD_Version__ < 105000000) || \
+      (__NetBSD_Version__ >= 105010000) && (__NetBSD_Version__ < 105020000)))
 int
 xf86mmap(dev, offset, length)
 	dev_t dev;
@@ -144,7 +153,11 @@ xf86mmap(dev, offset, length)
 		     && (unsigned)offset <= HOLE16M_END)
 #endif
 		     )) {
+#if __NetBSD_Version__ >= 106160000
+		return x86_btop(offset);
+#else
 		return i386_btop(offset);
+#endif
 	} else {
 		return(-1);
 	}