vm_kern.c (7ef6ba5d27fdecaea9bd3c03940c3ef29f081c02) vm_kern.c (099a0e588cbe1bbc56a565bf57d722621b47a866)
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

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

315 /*
316 * Locate sufficient space in the map. This will give us the final
317 * virtual address for the new memory, and thus will tell us the
318 * offset within the kernel map.
319 */
320 vm_map_lock(map);
321 if (vm_map_findspace(map, vm_map_min(map), size, &addr)) {
322 vm_map_unlock(map);
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

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

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

--- 193 unchanged lines hidden ---
323 if ((flags & M_NOWAIT) == 0)
324 panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
325 (long)size, (long)map->size);
326 return (0);
327 }
328 offset = addr - VM_MIN_KERNEL_ADDRESS;
329 vm_object_reference(kmem_object);
330 vm_map_insert(map, kmem_object, offset, addr, addr + size,

--- 193 unchanged lines hidden ---