diff options
author | jake <jake@FreeBSD.org> | 2002-09-21 22:07:17 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-09-21 22:07:17 +0000 |
commit | 2b71a04b1e46f7a598269467b77323fad8f53189 (patch) | |
tree | 5a29a2272e4b65acf468c2f877289cf21786b297 /sys/kern/init_main.c | |
parent | 5ea401e1a679065a9e8506758d9735855dc7a419 (diff) | |
download | FreeBSD-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/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 93afb1d..49bb739 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -435,8 +435,8 @@ KASSERT((ke->ke_kgrlist.tqe_next != ke), ("linked to self!")); pmap_pinit0(vmspace_pmap(&vmspace0)); p->p_vmspace = &vmspace0; vmspace0.vm_refcnt = 1; - vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS), - trunc_page(VM_MAXUSER_ADDRESS)); + vm_map_init(&vmspace0.vm_map, p->p_sysent->sv_minuser, + p->p_sysent->sv_maxuser); vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0); /* @@ -571,7 +571,7 @@ start_init(void *dummy) /* * Need just enough stack to hold the faked-up "execve()" arguments. */ - addr = trunc_page(USRSTACK - PAGE_SIZE); + addr = p->p_sysent->sv_usrstack - PAGE_SIZE; if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0) panic("init: couldn't allocate argument space"); @@ -603,7 +603,7 @@ start_init(void *dummy) * Move out the boot flag argument. */ options = 0; - ucp = (char *)USRSTACK; + ucp = (char *)p->p_sysent->sv_usrstack; (void)subyte(--ucp, 0); /* trailing zero */ if (boothowto & RB_SINGLE) { (void)subyte(--ucp, 's'); |