vfs: check userland buffers before reading them.
[haiku.git] / src / system / boot / arch / m68k / mmu.h
blob196a3bc14f7bc3e6f6c95df3a8b0ae466f4462e8
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
9 #include <SupportDefs.h>
12 // For use with mmu_map_physical_memory()
13 static const uint32 kDefaultPageFlags = 0x3; // present, R/W
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
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);
25 extern addr_t mmu_get_next_page_tables();
28 struct boot_mmu_ops {
29 void (*initialize)(void);
30 /* len=0 to disable */
31 status_t (*set_tt)(int which, addr_t pa, size_t len, uint32 perms);
32 /* load root pointers */
33 status_t (*load_rp)(addr_t pa);
34 status_t (*allocate_kernel_pgdirs)(void);
35 status_t (*enable_paging)(void);
36 status_t (*add_page_table)(addr_t virtualAddress);
37 void (*unmap_page)(addr_t virtualAddress);
38 void (*map_page)(addr_t virtualAddress, addr_t pa, uint32 flags);
41 extern const struct boot_mmu_ops k030MMUOps;
42 extern const struct boot_mmu_ops k040MMUOps;
43 extern const struct boot_mmu_ops k060MMUOps;
48 #ifdef __cplusplus
50 #endif
52 #endif /* MMU_H */