1/*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef KERNEL_ARCH_ARM_PAGING_32_BIT_ARM_VM_TRANSLATION_MAP_32_BIT_H
6#define KERNEL_ARCH_ARM_PAGING_32_BIT_ARM_VM_TRANSLATION_MAP_32_BIT_H
7
8
9#include "paging/ARMVMTranslationMap.h"
10
11
12struct ARMPagingStructures32Bit;
13
14
15struct ARMVMTranslationMap32Bit : ARMVMTranslationMap {
16								ARMVMTranslationMap32Bit();
17	virtual						~ARMVMTranslationMap32Bit();
18
19			status_t			Init(bool kernel);
20
21	virtual	size_t				MaxPagesNeededToMap(addr_t start,
22									addr_t end) const;
23
24	virtual	status_t			Map(addr_t virtualAddress,
25									phys_addr_t physicalAddress,
26									uint32 attributes, uint32 memoryType,
27									vm_page_reservation* reservation);
28	virtual	status_t			Unmap(addr_t start, addr_t end);
29
30	virtual	status_t			DebugMarkRangePresent(addr_t start, addr_t end,
31									bool markPresent);
32
33	virtual	status_t			UnmapPage(VMArea* area, addr_t address,
34									bool updatePageQueue);
35	virtual	void				UnmapPages(VMArea* area, addr_t base,
36									size_t size, bool updatePageQueue);
37	virtual	void				UnmapArea(VMArea* area,
38									bool deletingAddressSpace,
39									bool ignoreTopCachePageFlags);
40
41	virtual	status_t			Query(addr_t virtualAddress,
42									phys_addr_t* _physicalAddress,
43									uint32* _flags);
44	virtual	status_t			QueryInterrupt(addr_t virtualAddress,
45									phys_addr_t* _physicalAddress,
46									uint32* _flags);
47
48	virtual	status_t			Protect(addr_t base, addr_t top,
49									uint32 attributes, uint32 memoryType);
50
51	virtual status_t			SetFlags(addr_t virtualAddress, uint32 flags);
52
53	virtual	status_t			ClearFlags(addr_t virtualAddress,
54									uint32 flags);
55
56	virtual	bool				ClearAccessedAndModified(
57									VMArea* area, addr_t address,
58									bool unmapIfUnaccessed,
59									bool& _modified);
60
61	virtual	ARMPagingStructures* PagingStructures() const;
62	inline	ARMPagingStructures32Bit* PagingStructures32Bit() const
63									{ return fPagingStructures; }
64
65private:
66			ARMPagingStructures32Bit* fPagingStructures;
67};
68
69
70#endif	// KERNEL_ARCH_ARM_PAGING_32_BIT_ARM_VM_TRANSLATION_MAP_32_BIT_H
71