xref: /haiku/src/system/boot/platform/openfirmware/mmu.cpp (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 
6 
7 #include <platform_arch.h>
8 #include <boot/platform.h>
9 #include <boot/stdio.h>
10 #include <stdarg.h>
11 
12 #include "openfirmware.h"
13 
14 
15 status_t
16 platform_allocate_region(void **_address, size_t size, uint8 protection)
17 {
18 	void *address = arch_mmu_allocate(*_address, size, protection);
19 	if (address == NULL)
20 		return B_NO_MEMORY;
21 
22 	*_address = address;
23 	return B_OK;
24 }
25 
26 
27 status_t
28 platform_free_region(void *address, size_t size)
29 {
30 	return arch_mmu_free(address, size);
31 }
32 
33