Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm PR kern/50985: use the runtime limits of the vmspace...
details: https://anonhg.NetBSD.org/src/rev/5e4595e935da
branches: trunk
changeset: 345402:5e4595e935da
user: martin <martin%NetBSD.org@localhost>
date: Tue May 24 20:20:57 2016 +0000
description:
PR kern/50985: use the runtime limits of the vmspace in range_test()
instead of the compile time defaults for it.
diffstat:
sys/uvm/uvm_mmap.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diffs (122 lines):
diff -r ce30fcb8d8ee -r 5e4595e935da sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c Tue May 24 19:36:41 2016 +0000
+++ b/sys/uvm/uvm_mmap.c Tue May 24 20:20:57 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_mmap.c,v 1.157 2016/05/22 14:26:09 christos Exp $ */
+/* $NetBSD: uvm_mmap.c,v 1.158 2016/05/24 20:20:57 martin Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.157 2016/05/22 14:26:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.158 2016/05/24 20:20:57 martin Exp $");
#include "opt_compat_netbsd.h"
#include "opt_pax.h"
@@ -67,10 +67,10 @@
int, int, struct uvm_object *, voff_t, vsize_t);
static int
-range_test(vaddr_t addr, vsize_t size, bool ismmap)
+range_test(struct vm_map *map, vaddr_t addr, vsize_t size, bool ismmap)
{
- vaddr_t vm_min_address = VM_MIN_ADDRESS;
- vaddr_t vm_max_address = VM_MAXUSER_ADDRESS;
+ vaddr_t vm_min_address = vm_map_min(map);
+ vaddr_t vm_max_address = vm_map_max(map);
vaddr_t eaddr = addr + size;
int res = 0;
@@ -353,7 +353,7 @@
if (addr & PAGE_MASK)
return (EINVAL);
- error = range_test(addr, size, true);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, true);
if (error) {
return error;
}
@@ -480,15 +480,15 @@
size += pageoff;
size = (vsize_t)round_page(size);
- error = range_test(addr, size, false);
- if (error)
- return error;
/*
* get map
*/
+ map = &p->p_vmspace->vm_map;
- map = &p->p_vmspace->vm_map;
+ error = range_test(map, addr, size, false);
+ if (error)
+ return error;
/*
* XXXCDC: do we really need this semantic?
@@ -566,12 +566,12 @@
if (size == 0)
return (0);
- error = range_test(addr, size, false);
+ map = &p->p_vmspace->vm_map;
+
+ error = range_test(map, addr, size, false);
if (error)
return error;
- map = &p->p_vmspace->vm_map;
-
/*
* interesting system call semantic: make sure entire range is
* allocated before allowing an unmap.
@@ -627,7 +627,7 @@
size += pageoff;
size = round_page(size);
- error = range_test(addr, size, false);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, false);
if (error)
return error;
@@ -668,7 +668,7 @@
size += pageoff;
size = (vsize_t)round_page(size);
- error = range_test(addr, size, false);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, false);
if (error)
return error;
@@ -709,7 +709,7 @@
size += pageoff;
size = (vsize_t)round_page(size);
- error = range_test(addr, size, false);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, false);
if (error)
return error;
@@ -809,7 +809,7 @@
size += pageoff;
size = (vsize_t)round_page(size);
- error = range_test(addr, size, false);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, false);
if (error)
return error;
@@ -860,7 +860,7 @@
size += pageoff;
size = (vsize_t)round_page(size);
- error = range_test(addr, size, false);
+ error = range_test(&p->p_vmspace->vm_map, addr, size, false);
if (error)
return error;
Home |
Main Index |
Thread Index |
Old Index