diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 14:26:01 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 14:26:01 +0100 |
| commit | 800977c96cd64b3beeccaa7d373daed3987b1c2a (patch) | |
| tree | d97b5788f92b416f8f7f386ed9f179ab792b6f72 /Private/HALKit/AMD64/HalPageAlloc.cpp | |
| parent | e559cf01834340d0a4dfcb45f7bdf081e8994032 (diff) | |
Kernel: Improvements and fixes regarding the VMMers and assembly code.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/AMD64/HalPageAlloc.cpp')
| -rw-r--r-- | Private/HALKit/AMD64/HalPageAlloc.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp index 86631e57..6d6e4ba5 100644 --- a/Private/HALKit/AMD64/HalPageAlloc.cpp +++ b/Private/HALKit/AMD64/HalPageAlloc.cpp @@ -8,12 +8,12 @@ */ #include <HALKit/AMD64/HalPageAlloc.hpp> -#include <NewKit/Defines.hpp> #include <NewKit/RuntimeCheck.hpp> +#include <NewKit/Defines.hpp> // this files handles paging. -static HCore::UIntPtr kPagePtr = kPagePtrAddress; +static HCore::UIntPtr kPagePtr = 0; static HCore::SizeT kPageCnt = 0UL; namespace HCore { @@ -23,6 +23,7 @@ static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) char *ptr = &(reinterpret_cast<char *>(kPagePtr))[kPageCnt + 1]; PageTable64 *pte = reinterpret_cast<PageTable64 *>(ptr); + pte->Rw = rw; pte->User = user; pte->Present = true; @@ -52,5 +53,9 @@ auto hal_create_page(Boolean rw, Boolean user) -> UIntPtr { return reinterpret_cast<UIntPtr>(new_pte); } + +UIntPtr& hal_get_page_ptr() noexcept { return kPagePtr; } + +void hal_set_page_ptr(const UIntPtr& newPagePtr) noexcept { kPagePtr = newPagePtr; } } // namespace HAL } // namespace HCore |
