Deleted Added
full compact
vm_map.c (83366) vm_map.c (84783)
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 47 unchanged lines hidden (view full) ---

56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
57 * School of Computer Science
58 * Carnegie Mellon University
59 * Pittsburgh PA 15213-3890
60 *
61 * any improvements or extensions that they make and grant Carnegie the
62 * rights to redistribute these changes.
63 *
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 47 unchanged lines hidden (view full) ---

56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
57 * School of Computer Science
58 * Carnegie Mellon University
59 * Pittsburgh PA 15213-3890
60 *
61 * any improvements or extensions that they make and grant Carnegie the
62 * rights to redistribute these changes.
63 *
64 * $FreeBSD: head/sys/vm/vm_map.c 83366 2001-09-12 08:38:13Z julian $
64 * $FreeBSD: head/sys/vm/vm_map.c 84783 2001-10-10 23:06:54Z ps $
65 */
66
67/*
68 * Virtual memory mapping module.
69 */
70
71#include <sys/param.h>
72#include <sys/systm.h>

--- 2318 unchanged lines hidden (view full) ---

2391 vm_size_t init_ssize;
2392 int rv;
2393
2394 GIANT_REQUIRED;
2395
2396 if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
2397 return (KERN_NO_SPACE);
2398
65 */
66
67/*
68 * Virtual memory mapping module.
69 */
70
71#include <sys/param.h>
72#include <sys/systm.h>

--- 2318 unchanged lines hidden (view full) ---

2391 vm_size_t init_ssize;
2392 int rv;
2393
2394 GIANT_REQUIRED;
2395
2396 if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
2397 return (KERN_NO_SPACE);
2398
2399 if (max_ssize < SGROWSIZ)
2399 if (max_ssize < sgrowsiz)
2400 init_ssize = max_ssize;
2401 else
2400 init_ssize = max_ssize;
2401 else
2402 init_ssize = SGROWSIZ;
2402 init_ssize = sgrowsiz;
2403
2404 vm_map_lock(map);
2405
2406 /* If addr is already mapped, no go */
2407 if (vm_map_lookup_entry(map, addrbos, &prev_entry)) {
2408 vm_map_unlock(map);
2409 return (KERN_NO_SPACE);
2410 }

--- 126 unchanged lines hidden (view full) ---

2537 */
2538 if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
2539 p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
2540 vm_map_unlock_read(map);
2541 return (KERN_NO_SPACE);
2542 }
2543
2544 /* Round up the grow amount modulo SGROWSIZ */
2403
2404 vm_map_lock(map);
2405
2406 /* If addr is already mapped, no go */
2407 if (vm_map_lookup_entry(map, addrbos, &prev_entry)) {
2408 vm_map_unlock(map);
2409 return (KERN_NO_SPACE);
2410 }

--- 126 unchanged lines hidden (view full) ---

2537 */
2538 if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
2539 p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
2540 vm_map_unlock_read(map);
2541 return (KERN_NO_SPACE);
2542 }
2543
2544 /* Round up the grow amount modulo SGROWSIZ */
2545 grow_amount = roundup (grow_amount, SGROWSIZ);
2545 grow_amount = roundup (grow_amount, sgrowsiz);
2546 if (grow_amount > stack_entry->avail_ssize) {
2547 grow_amount = stack_entry->avail_ssize;
2548 }
2549 if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
2550 p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
2551 grow_amount = p->p_rlimit[RLIMIT_STACK].rlim_cur -
2552 ctob(vm->vm_ssize);
2553 }

--- 722 unchanged lines hidden ---
2546 if (grow_amount > stack_entry->avail_ssize) {
2547 grow_amount = stack_entry->avail_ssize;
2548 }
2549 if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
2550 p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
2551 grow_amount = p->p_rlimit[RLIMIT_STACK].rlim_cur -
2552 ctob(vm->vm_ssize);
2553 }

--- 722 unchanged lines hidden ---