summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-09-21 22:07:17 +0000
committerjake <jake@FreeBSD.org>2002-09-21 22:07:17 +0000
commit2b71a04b1e46f7a598269467b77323fad8f53189 (patch)
tree5a29a2272e4b65acf468c2f877289cf21786b297 /sys/vm/vm_map.c
parent5ea401e1a679065a9e8506758d9735855dc7a419 (diff)
downloadFreeBSD-src-2b71a04b1e46f7a598269467b77323fad8f53189.zip
FreeBSD-src-2b71a04b1e46f7a598269467b77323fad8f53189.tar.gz
Use the fields in the sysentvec and in the vm map header in place of the
constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS. This is mainly so that they can be variable even for the native abi, based on different machine types. Get stack protections from the sysentvec too. This makes it trivial to map the stack non-executable for certain abis, on machines that support it.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 857514b..386acbc 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -78,6 +78,7 @@
#include <sys/mman.h>
#include <sys/vnode.h>
#include <sys/resourcevar.h>
+#include <sys/sysent.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -2364,7 +2365,7 @@ vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
vm_size_t init_ssize;
int rv;
- if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
+ if (addrbos < vm_map_min(map))
return (KERN_NO_SPACE);
if (max_ssize < sgrowsiz)
@@ -2552,9 +2553,7 @@ Retry:
}
rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start,
- VM_PROT_ALL,
- VM_PROT_ALL,
- 0);
+ p->p_sysent->sv_stackprot, VM_PROT_ALL, 0);
/* Adjust the available stack space by the amount we grew. */
if (rv == KERN_SUCCESS) {
OpenPOWER on IntegriCloud