Deleted Added
full compact
vm_kern.c (81399) vm_kern.c (87157)
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_kern.c 81399 2001-08-10 06:56:12Z jhb $
64 * $FreeBSD: head/sys/vm/vm_kern.c 87157 2001-12-01 00:21:30Z luigi $
65 */
66
67/*
68 * Kernel memory management.
69 */
70
71#include <sys/param.h>
72#include <sys/systm.h>
65 */
66
67/*
68 * Kernel memory management.
69 */
70
71#include <sys/param.h>
72#include <sys/systm.h>
73#include <sys/kernel.h> /* for ticks and hz */
73#include <sys/lock.h>
74#include <sys/mutex.h>
75#include <sys/proc.h>
76#include <sys/malloc.h>
77
78#include <vm/vm.h>
79#include <vm/vm_param.h>
80#include <vm/pmap.h>

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

326 * Locate sufficient space in the map. This will give us the final
327 * virtual address for the new memory, and thus will tell us the
328 * offset within the kernel map.
329 */
330 vm_map_lock(map);
331 if (vm_map_findspace(map, vm_map_min(map), size, &addr)) {
332 vm_map_unlock(map);
333 if (map != kmem_map) {
74#include <sys/lock.h>
75#include <sys/mutex.h>
76#include <sys/proc.h>
77#include <sys/malloc.h>
78
79#include <vm/vm.h>
80#include <vm/vm_param.h>
81#include <vm/pmap.h>

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

327 * Locate sufficient space in the map. This will give us the final
328 * virtual address for the new memory, and thus will tell us the
329 * offset within the kernel map.
330 */
331 vm_map_lock(map);
332 if (vm_map_findspace(map, vm_map_min(map), size, &addr)) {
333 vm_map_unlock(map);
334 if (map != kmem_map) {
334 printf("Out of mbuf address space!\n");
335 printf("Consider increasing NMBCLUSTERS\n");
335 static int last_report; /* when we did it (in ticks) */
336 if (ticks < last_report ||
337 (ticks - last_report) >= hz) {
338 last_report = ticks;
339 printf("Out of mbuf address space!\n");
340 printf("Consider increasing NMBCLUSTERS\n");
341 }
336 goto bad;
337 }
338 if ((flags & M_NOWAIT) == 0)
339 panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
340 (long)size, (long)map->size);
341 goto bad;
342 }
343 offset = addr - VM_MIN_KERNEL_ADDRESS;

--- 162 unchanged lines hidden ---
342 goto bad;
343 }
344 if ((flags & M_NOWAIT) == 0)
345 panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
346 (long)size, (long)map->size);
347 goto bad;
348 }
349 offset = addr - VM_MIN_KERNEL_ADDRESS;

--- 162 unchanged lines hidden ---