diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-27 16:47:12 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-27 16:47:12 +0200 |
| commit | 86a2d7327f84519f525d66a7745554b41dddeb93 (patch) | |
| tree | 427d3747e0d94441216b1df6276105007c1bbe35 /Private/Source | |
| parent | d7519f338b544624145997576d2800f9670aa699 (diff) | |
MHR-18: Improved virtual memory architecture.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/PageAllocator.cxx | 4 | ||||
| -rw-r--r-- | Private/Source/PageManager.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Private/Source/PageAllocator.cxx b/Private/Source/PageAllocator.cxx index 9b1e05f0..d7635e99 100644 --- a/Private/Source/PageAllocator.cxx +++ b/Private/Source/PageAllocator.cxx @@ -26,7 +26,7 @@ void exec_disable(UIntPtr VirtualAddr) { MUST_PASS(!VirtualAddrTable->Accessed); VirtualAddrTable->ExecDisable = true; - hal_flush_tlb(VirtualAddr); + hal_flush_tlb(); } bool page_disable(UIntPtr VirtualAddr) { @@ -37,7 +37,7 @@ bool page_disable(UIntPtr VirtualAddr) { if (VirtualAddrTable->Accessed) return false; VirtualAddrTable->Present = false; - hal_flush_tlb(VirtualAddr); + hal_flush_tlb(); return true; } diff --git a/Private/Source/PageManager.cxx b/Private/Source/PageManager.cxx index 722df55e..368f2974 100644 --- a/Private/Source/PageManager.cxx +++ b/Private/Source/PageManager.cxx @@ -30,15 +30,15 @@ PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, PTEWrapper::~PTEWrapper() {} /// @brief Flush virtual address. -/// @param VirtAddr +/// @param VirtAddr void PageManager::FlushTLB(UIntPtr VirtAddr) { if (VirtAddr == kBadAddress) return; - hal_flush_tlb(VirtAddr); + hal_flush_tlb(); } /// @brief Reclaim freed page. -/// @return +/// @return bool PTEWrapper::Reclaim() { if (!this->fPresent) { this->fPresent = true; @@ -52,7 +52,7 @@ bool PTEWrapper::Reclaim() { /// @param Rw r/w? /// @param User user mode? /// @param ExecDisable disable execution on page? -/// @return +/// @return PTEWrapper PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable) { // Store PTE wrapper right after PTE. VoidPtr ptr = NewOS::HAL::hal_alloc_page(Rw, User); @@ -61,8 +61,8 @@ PTEWrapper PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable) { } /// @brief Disable PTE. -/// @param wrapper the wrapper. -/// @return +/// @param wrapper the wrapper. +/// @return bool PageManager::Free(Ref<PTEWrapper *> &wrapper) { if (wrapper) { if (!Detail::page_disable(wrapper->VirtualAddress())) return false; @@ -73,7 +73,7 @@ bool PageManager::Free(Ref<PTEWrapper *> &wrapper) { } /// @brief Virtual PTE address. -/// @return +/// @return The virtual address of the page. const UIntPtr PTEWrapper::VirtualAddress() { return (fVirtAddr); } |
