mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-05 04:19:16 +00:00
Added Check() function
This commit is contained in:
@ -5,6 +5,28 @@
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
bool Virtual::Check(void *VirtualAddress)
|
||||
{
|
||||
// 0x1000 aligned
|
||||
uint64_t Address = (uint64_t)VirtualAddress;
|
||||
Address &= 0xFFFFFFFFFFFFF000;
|
||||
debug("%#lx=>%#lx", VirtualAddress, Address);
|
||||
|
||||
PageMapIndexer Index = PageMapIndexer((uint64_t)Address);
|
||||
PageDirectoryEntry PDE = this->Table->Entries[Index.PDP_i];
|
||||
debug("%x %x %x %x %x %x %x %x %x %x %x %p-%#llx",
|
||||
PDE.Value.Present, PDE.Value.ReadWrite,
|
||||
PDE.Value.UserSupervisor, PDE.Value.WriteThrough,
|
||||
PDE.Value.CacheDisable, PDE.Value.Accessed,
|
||||
PDE.Value.Dirty, PDE.Value.PageSize,
|
||||
PDE.Value.Global, PDE.Value.PageAttributeTable,
|
||||
PDE.Value.ExecuteDisable, PDE.GetAddress(),
|
||||
PDE.Value);
|
||||
if (!PDE.GetFlag(PTFlag::P))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags)
|
||||
{
|
||||
SmartLock(this->MemoryLock);
|
||||
|
Reference in New Issue
Block a user