1 /* 2 * Copyright 2003, Axel Dörfler, axeld@pinc-software.de. 3 * All rights reserved. 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 <platform/openfirmware/openfirmware.h> 11 #include <stdarg.h> 12 13 14 status_t 15 platform_allocate_region(void **_address, size_t size, uint8 protection, 16 bool exactAddress) 17 { 18 if (size == 0) 19 return B_BAD_VALUE; 20 21 void *address = arch_mmu_allocate(*_address, size, protection, 22 exactAddress); 23 if (address == NULL) 24 return B_NO_MEMORY; 25 26 *_address = address; 27 return B_OK; 28 } 29 30 31 extern "C" status_t 32 platform_bootloader_address_to_kernel_address(void *address, addr_t *_result) 33 { 34 *_result = (addr_t)address; 35 return B_OK; 36 } 37 38 39 extern "C" status_t 40 platform_kernel_address_to_bootloader_address(addr_t address, void **_result) 41 { 42 *_result = (void*)address; 43 return B_OK; 44 } 45 46 47 status_t 48 platform_free_region(void *address, size_t size) 49 { 50 return arch_mmu_free(address, size); 51 } 52 53