1 |
/* Kernel allocator. |
/* Kernel allocator. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@opencores.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
156 |
size = vm_round_page (size); |
size = vm_round_page (size); |
157 |
kr = vm_map_allocate (map, &offset, size, VM_OBJECT_KERNEL (), |
kr = vm_map_allocate (map, &offset, size, VM_OBJECT_KERNEL (), |
158 |
VM_PROT_ALL, VM_PROT_ALL, VM_INHERIT_NONE, true); |
VM_PROT_ALL, VM_PROT_ALL, VM_INHERIT_NONE, true); |
159 |
|
if (kr != KERN_SUCCESS) |
160 |
|
trace_printf ("kr=%d", kr); |
161 |
assert (kr == KERN_SUCCESS); |
assert (kr == KERN_SUCCESS); |
162 |
|
|
163 |
return alloc_pages (VM_OBJECT_KERNEL (), offset, size, VM_PROT_ALL); |
return alloc_pages (VM_OBJECT_KERNEL (), offset, size, VM_PROT_ALL); |