mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-08-03 02:21:42 +00:00
Merge remote-tracking branch 'Kernel/memory-test' into Kernel-memory-test
This commit is contained in:
28
Kernel/Core/Memory/PageMapIndexer.cpp
Normal file
28
Kernel/Core/Memory/PageMapIndexer.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <memory.hpp>
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
Virtual::PageMapIndexer::PageMapIndexer(uint64_t VirtualAddress)
|
||||
{
|
||||
#if defined(__amd64__)
|
||||
uint64_t Address = VirtualAddress;
|
||||
Address >>= 12;
|
||||
this->PTEIndex = Address & 0x1FF;
|
||||
Address >>= 9;
|
||||
this->PDEIndex = Address & 0x1FF;
|
||||
Address >>= 9;
|
||||
this->PDPTEIndex = Address & 0x1FF;
|
||||
Address >>= 9;
|
||||
this->PMLIndex = Address & 0x1FF;
|
||||
#elif defined(__i386__)
|
||||
uint64_t Address = VirtualAddress;
|
||||
Address >>= 12;
|
||||
this->PTEIndex = Address & 0x3FF;
|
||||
Address >>= 10;
|
||||
this->PDEIndex = Address & 0x3FF;
|
||||
Address >>= 10;
|
||||
this->PDPTEIndex = Address & 0x3FF;
|
||||
#elif defined(__aarch64__)
|
||||
#endif
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user