xref: /haiku/src/system/boot/platform/openfirmware/mmu.cpp (revision c83d9dad1c3cb1b0910f5db8c3f4645d3a206171)
1 /*
2  * Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT 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 	bool exactAddress)
18 {
19 	if (size == 0)
20 		return B_BAD_VALUE;
21 
22 	void *address = arch_mmu_allocate(*_address, size, protection,
23 		exactAddress);
24 	if (address == NULL)
25 		return B_NO_MEMORY;
26 
27 	*_address = address;
28 	return B_OK;
29 }
30 
31 
32 status_t
33 platform_free_region(void *address, size_t size)
34 {
35 	return arch_mmu_free(address, size);
36 }
37 
38