xref: /haiku/src/system/kernel/arch/ppc/paging/classic/PPCVMTranslationMapClassic.h (revision 62caef87ce6f8e548727fe6561f3d47f46577abd)
1 /*
2  * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef KERNEL_ARCH_PPC_PAGING_CLASSIC_PPC_VM_TRANSLATION_MAP_CLASSIC_H
6 #define KERNEL_ARCH_PPC_PAGING_CLASSIC_PPC_VM_TRANSLATION_MAP_CLASSIC_H
7 
8 
9 #include "paging/PPCVMTranslationMap.h"
10 #include <arch_mmu.h>
11 
12 
13 struct PPCPagingStructuresClassic;
14 
15 
16 struct PPCVMTranslationMapClassic : PPCVMTranslationMap {
17 								PPCVMTranslationMapClassic();
18 	virtual						~PPCVMTranslationMapClassic();
19 
20 			status_t			Init(bool kernel);
21 
VSIDBasePPCVMTranslationMapClassic22 	inline	int					VSIDBase() const	{ return fVSIDBase; }
23 
24 	virtual void				ChangeASID();
25 
26 			page_table_entry*	LookupPageTableEntry(addr_t virtualAddress);
27 			bool				RemovePageTableEntry(addr_t virtualAddress);
28 
29 	virtual	size_t				MaxPagesNeededToMap(addr_t start,
30 									addr_t end) const;
31 
32 	virtual	status_t			Map(addr_t virtualAddress,
33 									phys_addr_t physicalAddress,
34 									uint32 attributes, uint32 memoryType,
35 									vm_page_reservation* reservation);
36 	virtual	status_t			Unmap(addr_t start, addr_t end);
37 
38 	virtual status_t			RemapAddressRange(addr_t *_virtualAddress,
39 									size_t size, bool unmap);
40 
41 	virtual	status_t			DebugMarkRangePresent(addr_t start, addr_t end,
42 									bool markPresent);
43 
44 	virtual	status_t			UnmapPage(VMArea* area, addr_t address,
45 									bool updatePageQueue);
46 	virtual	void				UnmapPages(VMArea* area, addr_t base,
47 									size_t size, bool updatePageQueue);
48 	virtual	void				UnmapArea(VMArea* area,
49 									bool deletingAddressSpace,
50 									bool ignoreTopCachePageFlags);
51 
52 	virtual	status_t			Query(addr_t virtualAddress,
53 									phys_addr_t* _physicalAddress,
54 									uint32* _flags);
55 	virtual	status_t			QueryInterrupt(addr_t virtualAddress,
56 									phys_addr_t* _physicalAddress,
57 									uint32* _flags);
58 
59 	virtual	status_t			Protect(addr_t base, addr_t top,
60 									uint32 attributes, uint32 memoryType);
61 
62 	virtual	status_t			ClearFlags(addr_t virtualAddress,
63 									uint32 flags);
64 
65 	virtual	bool				ClearAccessedAndModified(
66 									VMArea* area, addr_t address,
67 									bool unmapIfUnaccessed,
68 									bool& _modified);
69 
70 	virtual	PPCPagingStructures* PagingStructures() const;
PagingStructuresClassicPPCVMTranslationMapClassic71 	inline	PPCPagingStructuresClassic* PagingStructuresClassic() const
72 									{ return fPagingStructures; }
73 
74 private:
75 			PPCPagingStructuresClassic* fPagingStructures;
76 			//XXX:move to fPagingStructures?
77 			int					fVSIDBase;
78 };
79 
80 
81 #endif	// KERNEL_ARCH_PPC_PAGING_CLASSIC_PPC_VM_TRANSLATION_MAP_CLASSIC_H
82