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_free(void *virtualAddress, size_t size); 24 25 struct boot_mmu_ops { 26 /* len=0 to disable */ 27 status_t (*set_tt)(int which, addr_t pa, size_t len, uint32 perms); 28 /* load root pointers */ 29 status_t (*load_rp)(void/*XXX*/); 30 status_t (*enable_paging)(void); 31 32 }; 33 34 #ifdef __cplusplus 35 } 36 #endif 37 38 #endif /* MMU_H */ 39