2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef KERNEL_ARCH_X86_X86_VM_TRANSLATION_MAP_H
6 #define KERNEL_ARCH_X86_X86_VM_TRANSLATION_MAP_H
9 #include <vm/VMTranslationMap.h>
17 #define PAGE_INVALIDATE_CACHE_SIZE 64
20 struct X86PagingStructures
;
21 class TranslationMapPhysicalPageMapper
;
24 struct X86VMTranslationMap
: VMTranslationMap
{
25 X86VMTranslationMap();
26 virtual ~X86VMTranslationMap();
28 status_t
Init(bool kernel
);
30 virtual bool Lock() final
;
31 virtual void Unlock() final
;
33 virtual addr_t
MappedSize() const final
;
35 virtual void Flush() final
;
37 virtual X86PagingStructures
* PagingStructures() const = 0;
39 inline void InvalidatePage(addr_t address
);
42 TranslationMapPhysicalPageMapper
* fPageMapper
;
43 int fInvalidPagesCount
;
44 addr_t fInvalidPages
[PAGE_INVALIDATE_CACHE_SIZE
];
50 X86VMTranslationMap::InvalidatePage(addr_t address
)
52 if (fInvalidPagesCount
< PAGE_INVALIDATE_CACHE_SIZE
)
53 fInvalidPages
[fInvalidPagesCount
] = address
;
59 #endif // KERNEL_ARCH_X86_X86_VM_TRANSLATION_MAP_H