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_PPC_VM_TRANSLATION_MAP_H 6 #define KERNEL_ARCH_PPC_PPC_VM_TRANSLATION_MAP_H 7 8 9 #include <vm/VMTranslationMap.h> 10 11 12 #define PAGE_INVALIDATE_CACHE_SIZE 64 13 14 15 struct PPCPagingStructures; 16 class TranslationMapPhysicalPageMapper; 17 18 19 struct PPCVMTranslationMap : VMTranslationMap { 20 PPCVMTranslationMap(); 21 virtual ~PPCVMTranslationMap(); 22 23 status_t Init(bool kernel); 24 25 virtual bool Lock(); 26 virtual void Unlock(); 27 28 virtual addr_t MappedSize() const; 29 30 virtual void Flush(); 31 32 virtual PPCPagingStructures* PagingStructures() const = 0; 33 34 inline void InvalidatePage(addr_t address); 35 36 virtual status_t RemapAddressRange(addr_t *_virtualAddress, 37 size_t size, bool unmap) = 0; 38 39 40 virtual void ChangeASID() = 0; 41 42 protected: 43 //X86:TranslationMapPhysicalPageMapper* fPageMapper; 44 int fInvalidPagesCount; 45 addr_t fInvalidPages[PAGE_INVALIDATE_CACHE_SIZE]; 46 bool fIsKernelMap; 47 }; 48 49 50 void InvalidatePage(addr_t address)51PPCVMTranslationMap::InvalidatePage(addr_t address) 52 { 53 if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) 54 fInvalidPages[fInvalidPagesCount] = address; 55 56 fInvalidPagesCount++; 57 } 58 59 60 #endif // KERNEL_ARCH_PPC_PPC_VM_TRANSLATION_MAP_H 61