xref: /haiku/src/system/kernel/arch/sparc/arch_vm_translation_map.cpp (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2007-2010, François Revol, revol@free.fr.
3  * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
4  * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
5  * Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk.
6  * Distributed under the terms of the MIT License.
7  *
8  * Copyright 2001, Travis Geiselbrecht. All rights reserved.
9  * Distributed under the terms of the NewOS License.
10  */
11 
12 
13 #include <KernelExport.h>
14 #include <kernel.h>
15 #include <vm/vm.h>
16 #include <vm/vm_priv.h>
17 #include <vm/VMAddressSpace.h>
18 
19 
20 #define TRACE_VM_TMAP
21 #ifdef TRACE_VM_TMAP
22 #	define TRACE(x...) dprintf(x)
23 #else
24 #	define TRACE(x...) ;
25 #endif
26 
27 
28 status_t
29 arch_vm_translation_map_init(kernel_args *args,
30 	VMPhysicalPageMapper** _physicalPageMapper)
31 {
32 	TRACE("vm_translation_map_init: entry\n");
33 
34 #ifdef TRACE_VM_TMAP
35 	TRACE("physical memory ranges:\n");
36 	for (uint32 i = 0; i < args->num_physical_memory_ranges; i++) {
37 		phys_addr_t start = args->physical_memory_range[i].start;
38 		phys_addr_t end = start + args->physical_memory_range[i].size;
39 		TRACE("  %#10" B_PRIxPHYSADDR " - %#10" B_PRIxPHYSADDR "\n", start,
40 			end);
41 	}
42 
43 	TRACE("allocated physical ranges:\n");
44 	for (uint32 i = 0; i < args->num_physical_allocated_ranges; i++) {
45 		phys_addr_t start = args->physical_allocated_range[i].start;
46 		phys_addr_t end = start + args->physical_allocated_range[i].size;
47 		TRACE("  %#10" B_PRIxPHYSADDR " - %#10" B_PRIxPHYSADDR "\n", start,
48 			end);
49 	}
50 
51 	TRACE("allocated virtual ranges:\n");
52 	for (uint32 i = 0; i < args->num_virtual_allocated_ranges; i++) {
53 		addr_t start = args->virtual_allocated_range[i].start;
54 		addr_t end = start + args->virtual_allocated_range[i].size;
55 		TRACE("  %#10" B_PRIxADDR " - %#10" B_PRIxADDR "\n", start, end);
56 	}
57 #endif
58 
59 	return B_OK;
60 }
61 
62 
63 status_t
64 arch_vm_translation_map_init_post_sem(kernel_args *args)
65 {
66 	return B_OK;
67 }
68 
69 
70 status_t
71 arch_vm_translation_map_init_post_area(kernel_args *args)
72 {
73 	TRACE("vm_translation_map_init_post_area: entry\n");
74 	return B_OK;
75 }
76 
77 
78 status_t
79 arch_vm_translation_map_early_map(kernel_args *args, addr_t va, phys_addr_t pa,
80 	uint8 attributes, phys_addr_t (*get_free_page)(kernel_args *))
81 {
82 	TRACE("early_tmap: entry pa 0x%lx va 0x%lx\n", pa, va);
83 	return B_OK;
84 }
85 
86 
87 status_t
88 arch_vm_translation_map_create_map(bool kernel, VMTranslationMap** _map)
89 {
90 	return B_OK;
91 }
92 
93 
94 bool
95 arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress,
96 	uint32 protection)
97 {
98 	return false;
99 }
100 
101