mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Better address check
This commit is contained in:
parent
08ab104eb1
commit
5f320bcf25
@ -13,7 +13,33 @@ namespace Memory
|
|||||||
|
|
||||||
PageMapIndexer Index = PageMapIndexer((uint64_t)Address);
|
PageMapIndexer Index = PageMapIndexer((uint64_t)Address);
|
||||||
PageDirectoryEntry PDE = this->Table->Entries[Index.PDPIndex];
|
PageDirectoryEntry PDE = this->Table->Entries[Index.PDPIndex];
|
||||||
return PDE.GetFlag(Flag);
|
PageTable *PDP = nullptr;
|
||||||
|
PageTable *PD = nullptr;
|
||||||
|
PageTable *PT = nullptr;
|
||||||
|
if (PDE.GetFlag(Flag))
|
||||||
|
PDP = (PageTable *)((uint64_t)PDE.GetAddress() << 12);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
PDE = PDP->Entries[Index.PDIndex];
|
||||||
|
if (PDE.GetFlag(Flag))
|
||||||
|
PD = (PageTable *)((uint64_t)PDE.GetAddress() << 12);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
PDE = PD->Entries[Index.PTIndex];
|
||||||
|
if (PDE.GetFlag(Flag))
|
||||||
|
PT = (PageTable *)((uint64_t)PDE.GetAddress() << 12);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
PDE = PT->Entries[Index.PIndex];
|
||||||
|
if (PDE.GetFlag(Flag))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags)
|
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user