1 /* 2 * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef MMU_H 6 #define MMU_H 7 8 9 #include <SupportDefs.h> 10 11 12 // For use with mmu_map_physical_memory() 13 static const uint32 kDefaultPageFlags = 0x3; // present, R/W 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 extern void mmu_init(void); 20 extern void mmu_init_for_kernel(void); 21 extern addr_t mmu_map_physical_memory(addr_t physicalAddress, size_t size, uint32 flags); 22 extern void *mmu_allocate(void *virtualAddress, size_t size); 23 extern void *mmu_allocate_page(addr_t *_physicalAddress); 24 extern bool mmu_allocate_physical(addr_t base, size_t size); 25 extern void mmu_free(void *virtualAddress, size_t size); 26 27 // Used by the long mode switch code 28 extern size_t mmu_get_virtual_usage(); 29 extern bool mmu_get_virtual_mapping(addr_t virtualAddress, 30 addr_t *_physicalAddress); 31 32 #ifdef __cplusplus 33 } 34 #endif 35 36 #endif /* MMU_H */ 37