xref: /haiku/src/system/kernel/arch/m68k/arch_030_mmu.cpp (revision 98977abc9beaa1f8c7180092d0f5124cb62c5c97)
14e44040dSFrançois Revol /*
24e44040dSFrançois Revol  * Copyright 2007, Haiku Inc. All rights reserved.
34e44040dSFrançois Revol  * Distributed under the terms of the MIT License.
44e44040dSFrançois Revol  *
54e44040dSFrançois Revol  * Authors:
64e44040dSFrançois Revol  * 		François Revol <revol@free.fr>
74e44040dSFrançois Revol  */
84e44040dSFrançois Revol 
94e44040dSFrançois Revol #include <arch/cpu.h>
104e44040dSFrançois Revol 
1124ec4307SFrançois Revol #include <arch_030_mmu.h>
124e44040dSFrançois Revol 
131fd024beSFrançois Revol #define ARCH_M68K_MMU_TYPE 68030
144e44040dSFrançois Revol 
154e44040dSFrançois Revol #include "arch_vm_translation_map_impl.cpp"
164e44040dSFrançois Revol 
171fd024beSFrançois Revol static void
set_pgdir(void * rt)181fd024beSFrançois Revol set_pgdir(void *rt)
191fd024beSFrançois Revol {
201fd024beSFrançois Revol 	long_page_directory_entry entry;
211fd024beSFrançois Revol 	*(uint64 *)&entry = DFL_PAGEENT_VAL;
221fd024beSFrançois Revol 	entry.type = DT_ROOT;
231fd024beSFrançois Revol 	entry.addr = TA_TO_PREA(((addr_t)rt));
241fd024beSFrançois Revol 
251fd024beSFrançois Revol 	asm volatile( \
261fd024beSFrançois Revol 		"pmove (%0),%%srp\n" \
271fd024beSFrançois Revol 		"pmove (%0),%%crp\n" \
281fd024beSFrançois Revol 		: : "a"((uint64 *)&entry));
291fd024beSFrançois Revol 
301fd024beSFrançois Revol }
311fd024beSFrançois Revol 
321fd024beSFrançois Revol 
334e44040dSFrançois Revol struct m68k_vm_ops m68030_vm_ops = {
341fd024beSFrançois Revol 	_m68k_translation_map_get_pgdir,
354237dbd0SFrançois Revol 	m68k_vm_translation_map_init_map,
364237dbd0SFrançois Revol 	m68k_vm_translation_map_init_kernel_map_post_sem,
374237dbd0SFrançois Revol 	m68k_vm_translation_map_init,
384237dbd0SFrançois Revol 	m68k_vm_translation_map_init_post_area,
394237dbd0SFrançois Revol 	m68k_vm_translation_map_init_post_sem,
404237dbd0SFrançois Revol 	m68k_vm_translation_map_early_map,
414237dbd0SFrançois Revol 	/*m68k_vm_translation_map_*/early_query,
421fd024beSFrançois Revol 	set_pgdir,
434e44040dSFrançois Revol #if 0
444e44040dSFrançois Revol 	m68k_map_address_range,
454e44040dSFrançois Revol 	m68k_unmap_address_range,
464e44040dSFrançois Revol 	m68k_remap_address_range
474e44040dSFrançois Revol #endif
48*98977abcSFrançois Revol 	m68k_vm_translation_map_is_kernel_page_accessible
494e44040dSFrançois Revol };
50