Module Name:    src
Committed By:   snj
Date:           Tue Jun 23 06:56:52 UTC 2009

Modified Files:
        src/sys/sys [netbsd-5]: conf.h
        src/sys/uvm [netbsd-5]: uvm_device.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #826):
        sys/sys/conf.h: revision 1.135
        sys/uvm/uvm_device.c: revision 1.56
add a workaround for drm:
for device mmap()'s, if the D_NEGOFFSAFE flag is set, do not check
if the offset is negative.
this should go away with the test itself when all drivers are audited
and checked to not fail with negative offsets.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.131.8.1 src/sys/sys/conf.h
cvs rdiff -u -r1.54 -r1.54.8.1 src/sys/uvm/uvm_device.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/conf.h
diff -u src/sys/sys/conf.h:1.131 src/sys/sys/conf.h:1.131.8.1
--- src/sys/sys/conf.h:1.131	Mon May 19 17:15:00 2008
+++ src/sys/sys/conf.h	Tue Jun 23 06:56:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.h,v 1.131 2008/05/19 17:15:00 ad Exp $	*/
+/*	$NetBSD: conf.h,v 1.131.8.1 2009/06/23 06:56:51 snj Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -61,6 +61,7 @@
 #define	D_TTY		0x0003
 #define	D_TYPEMASK	0x00ff
 #define	D_MPSAFE	0x0100
+#define	D_NEGOFFSAFE	0x0200
 
 /*
  * Block device switch table

Index: src/sys/uvm/uvm_device.c
diff -u src/sys/uvm/uvm_device.c:1.54 src/sys/uvm/uvm_device.c:1.54.8.1
--- src/sys/uvm/uvm_device.c:1.54	Wed Jun  4 13:35:24 2008
+++ src/sys/uvm/uvm_device.c	Tue Jun 23 06:56:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_device.c,v 1.54 2008/06/04 13:35:24 ad Exp $	*/
+/*	$NetBSD: uvm_device.c,v 1.54.8.1 2009/06/23 06:56:52 snj Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.54 2008/06/04 13:35:24 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.54.8.1 2009/06/23 06:56:52 snj Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -143,7 +143,8 @@
 	 * Negative offsets on the object are not allowed.
 	 */
 
-	if (off != UVM_UNKNOWN_OFFSET && off < 0)
+	if ((cdev->d_flag & D_NEGOFFSAFE) == 0 &&
+	    off != UVM_UNKNOWN_OFFSET && off < 0)
 		return(NULL);
 
 	/*

Reply via email to