2 * Copyright 2007, François Revol, revol@free.fr.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de.
6 * Distributed under the terms of the MIT License.
8 * Copyright 2001, Travis Geiselbrecht. All rights reserved.
9 * Distributed under the terms of the NewOS License.
13 #include <KernelExport.h>
16 #include <boot/kernel_args.h>
19 #include <vm/vm_types.h>
21 //#include <arch_mmu.h>
24 //#define TRACE_ARCH_VM
26 # define TRACE(x) dprintf x
33 arch_vm_init(kernel_args
*args
)
35 TRACE(("arch_vm_init: entry\n"));
41 arch_vm_init2(kernel_args
*args
)
48 arch_vm_init_post_area(kernel_args
*args
)
50 TRACE(("arch_vm_init_post_area: entry\n"));
56 arch_vm_init_end(kernel_args
*args
)
58 // Throw away all mappings that are unused by the kernel
59 vm_free_unused_boot_loader_range(KERNEL_LOAD_BASE
, KERNEL_SIZE
);
66 arch_vm_init_post_modules(kernel_args
*args
)
73 arch_vm_aspace_swap(struct VMAddressSpace
*from
, struct VMAddressSpace
*to
)
75 // This functions is only invoked when a userland thread is in the process
76 // of dying. It switches to the kernel team and does whatever cleanup is
77 // necessary (in case it is the team's main thread, it will delete the
79 // It is however not necessary to change the page directory. Userland team's
80 // page directories include all kernel mappings as well. Furthermore our
81 // arch specific translation map data objects are ref-counted, so they won't
82 // go away as long as they are still used on any CPU.
87 arch_vm_supports_protection(uint32 protection
)
89 // TODO check ARM protection possibilities
95 arch_vm_unset_memory_type(VMArea
*area
)
102 arch_vm_set_memory_type(VMArea
*area
, phys_addr_t physicalBase
, uint32 type
)
105 dprintf("%s: undefined type %lx!\n", __PRETTY_FUNCTION__
, type
);