diff options
| author | Peter Wemm <peter@FreeBSD.org> | 1999-04-19 14:14:14 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 1999-04-19 14:14:14 +0000 |
| commit | db42d90829b451163479b271c7b6c0811b4656ba (patch) | |
| tree | dc49838ef7da183b9c6c5cd5541a25faccb915f7 /sys/powerpc | |
| parent | 5f5a2519b4bf850ac104b70c30bae81f9c68d20f (diff) | |
Notes
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 658f730197d4..37fce542203e 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 658f730197d4..37fce542203e 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; |
