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