diff options
Diffstat (limited to 'sys/uvm/uvm_device.c')
-rw-r--r-- | sys/uvm/uvm_device.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index b2c8d7b7e0c..196fcdcddd2 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uvm_device.c,v 1.10 2001/08/06 14:03:04 art Exp $ */ -/* $NetBSD: uvm_device.c,v 1.20 2000/03/26 20:54:46 kleink Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.11 2001/08/11 10:57:22 art Exp $ */ +/* $NetBSD: uvm_device.c,v 1.22 2000/05/28 10:21:55 drochner Exp $ */ /* * @@ -95,7 +95,6 @@ struct uvm_pagerops uvm_deviceops = { udv_put, NULL, /* no cluster function */ NULL, /* no put cluster function */ - NULL, /* no share protect. no share maps for us */ NULL, /* no AIO-DONE function since no async i/o */ NULL, /* no releasepg function since no normal pages */ }; @@ -131,7 +130,7 @@ struct uvm_object * udv_attach(arg, accessprot, off, size) void *arg; vm_prot_t accessprot; - vaddr_t off; /* used only for access check */ + voff_t off; /* used only for access check */ vsize_t size; /* used only for access check */ { dev_t device = *((dev_t *) arg); @@ -152,6 +151,15 @@ udv_attach(arg, accessprot, off, size) return(NULL); /* + * As long as the device d_mmap interface gets an "int" + * offset, we have to watch out not to overflow its + * numeric range. (assuming it will be interpreted as + * "unsigned") + */ + if (((off + size - 1) & (u_int)-1) != off + size - 1) + return (0); + + /* * Check that the specified range of the device allows the * desired protection. * |