1 /* 2 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef ARCH_M68K_VM_H 6 #define ARCH_M68K_VM_H 7 8 #include <vm/VMTranslationMap.h> 9 10 /* This many pages will be read/written on I/O if possible */ 11 12 #define NUM_IO_PAGES 4 13 /* 16 kB */ 14 15 #define PAGE_SHIFT 12 16 17 18 struct m68k_vm_ops { 19 void *(*m68k_translation_map_get_pgdir)(VMTranslationMap *map); 20 status_t (*arch_vm_translation_map_init_map)(VMTranslationMap *map, bool kernel); 21 status_t (*arch_vm_translation_map_init_kernel_map_post_sem)(VMTranslationMap *map); 22 status_t (*arch_vm_translation_map_init)(kernel_args *args); 23 status_t (*arch_vm_translation_map_init_post_area)(kernel_args *args); 24 status_t (*arch_vm_translation_map_init_post_sem)(kernel_args *args); 25 status_t (*arch_vm_translation_map_early_map)(kernel_args *ka, addr_t virtualAddress, addr_t physicalAddress, 26 uint8 attributes, addr_t (*get_free_page)(kernel_args *)); 27 status_t (*arch_vm_translation_map_early_query)(addr_t va, addr_t *out_physical); 28 void (*m68k_set_pgdir)(void *); 29 #if 0 /* ppc stuff only ? */ 30 status_t (*m68k_map_address_range)(addr_t virtualAddress, addr_t physicalAddress, 31 size_t size); 32 void (*m68k_unmap_address_range)(addr_t virtualAddress, size_t size); 33 status_t (*m68k_remap_address_range)(addr_t *_virtualAddress, size_t size, bool unmap); 34 #endif 35 bool (*arch_vm_translation_map_is_kernel_page_accessible)(addr_t virtualAddress, uint32 protection); 36 37 }; 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 extern struct m68k_vm_ops *get_vm_ops(); 44 45 extern void *m68k_translation_map_get_pgdir(VMTranslationMap *map); 46 extern void m68k_set_pgdir(void *rt); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* ARCH_M68K_VM_H */ 53