@@ -1,4 +1,4 @@
-/* $NetBSD: conf.h,v 1.134 2009/02/02 14:00:27 haad Exp $ */
+/* $NetBSD: conf.h,v 1.135 2009/06/20 19:24:27 mrg 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
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_device.c,v 1.55 2008/12/17 20:51:39 cegger Exp $ */
+/* $NetBSD: uvm_device.c,v 1.56 2009/06/20 19:24:27 mrg Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.55 2008/12/17 20:51:39 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.56 2009/06/20 19:24:27 mrg 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);
/*