xref: /haiku/src/system/kernel/arch/arm/arch_vm.cpp (revision 90d870c1556bdc415c7f41de5474ebebb0ceebdd)
123eafdafSFrançois Revol /*
223eafdafSFrançois Revol  * Copyright 2007, François Revol, revol@free.fr.
323eafdafSFrançois Revol  * Distributed under the terms of the MIT License.
423eafdafSFrançois Revol  *
523eafdafSFrançois Revol  * Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de.
623eafdafSFrançois Revol  * Distributed under the terms of the MIT License.
723eafdafSFrançois Revol  *
823eafdafSFrançois Revol  * Copyright 2001, Travis Geiselbrecht. All rights reserved.
923eafdafSFrançois Revol  * Distributed under the terms of the NewOS License.
1023eafdafSFrançois Revol  */
1123eafdafSFrançois Revol 
1223eafdafSFrançois Revol #include <KernelExport.h>
1323eafdafSFrançois Revol 
1423eafdafSFrançois Revol #include <kernel.h>
1523eafdafSFrançois Revol #include <boot/kernel_args.h>
1623eafdafSFrançois Revol 
1723eafdafSFrançois Revol #include <vm.h>
1823eafdafSFrançois Revol #include <vm_types.h>
1923eafdafSFrançois Revol #include <arch/vm.h>
2023eafdafSFrançois Revol //#include <arch_mmu.h>
2123eafdafSFrançois Revol 
2223eafdafSFrançois Revol 
2323eafdafSFrançois Revol //#define TRACE_ARCH_VM
2423eafdafSFrançois Revol #ifdef TRACE_ARCH_VM
2523eafdafSFrançois Revol #	define TRACE(x) dprintf x
2623eafdafSFrançois Revol #else
2723eafdafSFrançois Revol #	define TRACE(x) ;
2823eafdafSFrançois Revol #endif
2923eafdafSFrançois Revol 
3023eafdafSFrançois Revol #warning M68K: WRITEME
3123eafdafSFrançois Revol 
3223eafdafSFrançois Revol status_t
3323eafdafSFrançois Revol arch_vm_init(kernel_args *args)
3423eafdafSFrançois Revol {
3523eafdafSFrançois Revol 	return B_OK;
3623eafdafSFrançois Revol }
3723eafdafSFrançois Revol 
3823eafdafSFrançois Revol 
3923eafdafSFrançois Revol status_t
4023eafdafSFrançois Revol arch_vm_init2(kernel_args *args)
4123eafdafSFrançois Revol {
4223eafdafSFrançois Revol //	int bats[8];
4323eafdafSFrançois Revol //	int i;
4423eafdafSFrançois Revol 
4523eafdafSFrançois Revol 	/**/
4623eafdafSFrançois Revol #warning M68K: disable TT0 and TT1, set up pmmu
4723eafdafSFrançois Revol 
4823eafdafSFrançois Revol 	return B_OK;
4923eafdafSFrançois Revol }
5023eafdafSFrançois Revol 
5123eafdafSFrançois Revol 
5223eafdafSFrançois Revol status_t
5323eafdafSFrançois Revol arch_vm_init_post_area(kernel_args *args)
5423eafdafSFrançois Revol {
5523eafdafSFrançois Revol 	return B_OK;
5623eafdafSFrançois Revol }
5723eafdafSFrançois Revol 
5823eafdafSFrançois Revol 
5923eafdafSFrançois Revol status_t
6023eafdafSFrançois Revol arch_vm_init_end(kernel_args *args)
6123eafdafSFrançois Revol {
6223eafdafSFrançois Revol 
6323eafdafSFrançois Revol #warning M68K: unset TT0 now
6423eafdafSFrançois Revol 	return B_OK;
6523eafdafSFrançois Revol }
6623eafdafSFrançois Revol 
6723eafdafSFrançois Revol 
6823eafdafSFrançois Revol status_t
6923eafdafSFrançois Revol arch_vm_init_post_modules(kernel_args *args)
7023eafdafSFrançois Revol {
7123eafdafSFrançois Revol 	return B_OK;
7223eafdafSFrançois Revol }
7323eafdafSFrançois Revol 
7423eafdafSFrançois Revol 
7523eafdafSFrançois Revol void
76b0db552cSIngo Weinhold arch_vm_aspace_swap(struct VMAddressSpace *from, struct VMAddressSpace *to)
7723eafdafSFrançois Revol {
7823eafdafSFrançois Revol #warning ARM:WRITEME
79*90d870c1SIngo Weinhold //	m68k_set_pgdir(m68k_translation_map_get_pgdir(&to->TranslationMap()));
8023eafdafSFrançois Revol }
8123eafdafSFrançois Revol 
8223eafdafSFrançois Revol 
8323eafdafSFrançois Revol bool
8423eafdafSFrançois Revol arch_vm_supports_protection(uint32 protection)
8523eafdafSFrançois Revol {
8623eafdafSFrançois Revol 	return true;
8723eafdafSFrançois Revol }
8823eafdafSFrançois Revol 
8923eafdafSFrançois Revol 
9023eafdafSFrançois Revol void
91a99eb6b5SIngo Weinhold arch_vm_unset_memory_type(VMArea *area)
9223eafdafSFrançois Revol {
9323eafdafSFrançois Revol }
9423eafdafSFrançois Revol 
9523eafdafSFrançois Revol 
9623eafdafSFrançois Revol status_t
97a99eb6b5SIngo Weinhold arch_vm_set_memory_type(VMArea *area, addr_t physicalBase, uint32 type)
9823eafdafSFrançois Revol {
9923eafdafSFrançois Revol 	if (type == 0)
10023eafdafSFrançois Revol 		return B_OK;
10123eafdafSFrançois Revol 
10223eafdafSFrançois Revol 	return B_ERROR;
10323eafdafSFrançois Revol }
104