diff options
author | peter <peter@FreeBSD.org> | 1999-04-19 14:14:14 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-19 14:14:14 +0000 |
commit | a74bdeb7d109443c9e5e0c792c2259175cb4174b (patch) | |
tree | 2acafa9158dea8a7e748a4a8903244b94ab9b1fa /sys/powerpc | |
parent | 2fc2e936d3183fa2f055ea3ee01fe2cef1596055 (diff) | |
download | FreeBSD-src-a74bdeb7d109443c9e5e0c792c2259175cb4174b.zip FreeBSD-src-a74bdeb7d109443c9e5e0c792c2259175cb4174b.tar.gz |
unifdef -DVM_STACK - it's been on for a while for x86 and was checked
and appeared to be working for the Alpha some time ago.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 57 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 57 |
2 files changed, 2 insertions, 112 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 658f730..37fce54 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.10 1999/02/08 00:47:32 dillon Exp $ + * $Id: vm_machdep.c,v 1.11 1999/02/08 02:42:12 dillon Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -365,60 +365,6 @@ cpu_reset() prom_halt(0); } -#ifndef VM_STACK -/* - * Grow the user stack to allow for 'sp'. This version grows the stack in - * chunks of SGROWSIZ. - */ -int -grow(p, sp) - struct proc *p; - size_t sp; -{ - unsigned int nss; - caddr_t v; - struct vmspace *vm = p->p_vmspace; - - if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK) - return (1); - - nss = roundup(USRSTACK - sp, PAGE_SIZE); - - if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur) - return (0); - - if (vm->vm_ssize && roundup(vm->vm_ssize << PAGE_SHIFT, - SGROWSIZ) < nss) { - int grow_amount; - /* - * If necessary, grow the VM that the stack occupies - * to allow for the rlimit. This allows us to not have - * to allocate all of the VM up-front in execve (which - * is expensive). - * Grow the VM by the amount requested rounded up to - * the nearest SGROWSIZ to provide for some hysteresis. - */ - grow_amount = roundup((nss - (vm->vm_ssize << PAGE_SHIFT)), SGROWSIZ); - v = (char *)USRSTACK - roundup(vm->vm_ssize << PAGE_SHIFT, - SGROWSIZ) - grow_amount; - /* - * If there isn't enough room to extend by SGROWSIZ, then - * just extend to the maximum size - */ - if (v < vm->vm_maxsaddr) { - v = vm->vm_maxsaddr; - grow_amount = MAXSSIZ - (vm->vm_ssize << PAGE_SHIFT); - } - if ((grow_amount == 0) || (vm_map_find(&vm->vm_map, NULL, 0, (vm_offset_t *)&v, - grow_amount, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != KERN_SUCCESS)) { - return (0); - } - vm->vm_ssize += grow_amount >> PAGE_SHIFT; - } - - return (1); -} -#else int grow_stack(p, sp) struct proc *p; @@ -432,7 +378,6 @@ grow_stack(p, sp) return (1); } -#endif static int cnt_prezero; diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 658f730..37fce54 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.10 1999/02/08 00:47:32 dillon Exp $ + * $Id: vm_machdep.c,v 1.11 1999/02/08 02:42:12 dillon Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -365,60 +365,6 @@ cpu_reset() prom_halt(0); } -#ifndef VM_STACK -/* - * Grow the user stack to allow for 'sp'. This version grows the stack in - * chunks of SGROWSIZ. - */ -int -grow(p, sp) - struct proc *p; - size_t sp; -{ - unsigned int nss; - caddr_t v; - struct vmspace *vm = p->p_vmspace; - - if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK) - return (1); - - nss = roundup(USRSTACK - sp, PAGE_SIZE); - - if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur) - return (0); - - if (vm->vm_ssize && roundup(vm->vm_ssize << PAGE_SHIFT, - SGROWSIZ) < nss) { - int grow_amount; - /* - * If necessary, grow the VM that the stack occupies - * to allow for the rlimit. This allows us to not have - * to allocate all of the VM up-front in execve (which - * is expensive). - * Grow the VM by the amount requested rounded up to - * the nearest SGROWSIZ to provide for some hysteresis. - */ - grow_amount = roundup((nss - (vm->vm_ssize << PAGE_SHIFT)), SGROWSIZ); - v = (char *)USRSTACK - roundup(vm->vm_ssize << PAGE_SHIFT, - SGROWSIZ) - grow_amount; - /* - * If there isn't enough room to extend by SGROWSIZ, then - * just extend to the maximum size - */ - if (v < vm->vm_maxsaddr) { - v = vm->vm_maxsaddr; - grow_amount = MAXSSIZ - (vm->vm_ssize << PAGE_SHIFT); - } - if ((grow_amount == 0) || (vm_map_find(&vm->vm_map, NULL, 0, (vm_offset_t *)&v, - grow_amount, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != KERN_SUCCESS)) { - return (0); - } - vm->vm_ssize += grow_amount >> PAGE_SHIFT; - } - - return (1); -} -#else int grow_stack(p, sp) struct proc *p; @@ -432,7 +378,6 @@ grow_stack(p, sp) return (1); } -#endif static int cnt_prezero; |