diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-15 10:40:40 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-15 10:40:40 +0100 |
| commit | 1a844fe4332313983e86efd1f3e41f8a7f73c465 (patch) | |
| tree | 8b008ff5960dc21cab960103b69334e53eebf228 /Private/HALKit | |
| parent | b3e76bf866b4223390585589786600475c9fdcae (diff) | |
Kernel: Update README and fix MUST_PASS in hal_try_alloc_new_page.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/HALKit')
| -rw-r--r-- | Private/HALKit/AMD64/HalPageAlloc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp index a52eb646..599810f3 100644 --- a/Private/HALKit/AMD64/HalPageAlloc.cpp +++ b/Private/HALKit/AMD64/HalPageAlloc.cpp @@ -11,15 +11,15 @@ // this files handles paging. -static HCore::SizeT kPageCnt = 0UL; +STATIC HCore::SizeT kPageCnt = 0UL; -#define kKernelPagingPadding 4096 +#define kKernelPagingPadding (4096) namespace HCore { namespace HAL { static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) -> PageTable64 * { - MUST_PASS(sz != 0); + MUST_PASS(sz > 0); PageTable64 *pte = &reinterpret_cast<PageDirectory64 *>((UIntPtr)kKernelVirtualStart)->Pte[0]; @@ -32,6 +32,7 @@ static auto hal_try_alloc_new_page(SizeT sz, Boolean rw, Boolean user) kKernelVirtualStart = (VoidPtr)((UIntPtr)kKernelVirtualStart + kPageCnt + sz + kKernelPagingPadding); + return pte; } |
