diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-03 12:07:56 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-03 12:07:56 +0200 |
| commit | 84e9149147e58067b08ca3cb14cfd749766d3a8b (patch) | |
| tree | 015ee123ff798371094ffae91c58be5d056d292a | |
| parent | 3facc32b746a44b0e3a91cbe1897127194396d1b (diff) | |
Bugfix: Free the page when done with it (Kernel Heap)
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
| -rw-r--r-- | Private/KernelKit/ThreadLocalStorage.hxx | 8 | ||||
| -rw-r--r-- | Private/Source/KernelHeap.cxx | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Private/KernelKit/ThreadLocalStorage.hxx b/Private/KernelKit/ThreadLocalStorage.hxx index 4abd9ecd..bdf00a8a 100644 --- a/Private/KernelKit/ThreadLocalStorage.hxx +++ b/Private/KernelKit/ThreadLocalStorage.hxx @@ -36,14 +36,14 @@ struct PACKED ThreadInformationBlock final { NewOS::Int32 ThreadID; // Thread execution ID. }; -/// @brief TLS install TIB -EXTERN_C void rt_install_tib(ThreadInformationBlock *pTib, NewOS::VoidPtr pPib); +/// @brief TLS install TIB and PIB. +EXTERN_C void rt_install_tib(ThreadInformationBlock *TIB, NewOS::VoidPtr PIB); ///! @brief Cookie Sanity check. -NewOS::Boolean tls_check_tib(ThreadInformationBlock* ptr); +NewOS::Boolean tls_check_tib(ThreadInformationBlock* Ptr); /// @brief TLS check system call -EXTERN_C NewOS::Void tls_check_syscall_impl(NewOS::HAL::StackFramePtr stackPtr) noexcept; +EXTERN_C NewOS::Void tls_check_syscall_impl(NewOS::HAL::StackFramePtr StackPtr) noexcept; #include <KernelKit/ThreadLocalStorage.inl> diff --git a/Private/Source/KernelHeap.cxx b/Private/Source/KernelHeap.cxx index a4a0b323..d47b6931 100644 --- a/Private/Source/KernelHeap.cxx +++ b/Private/Source/KernelHeap.cxx @@ -95,6 +95,11 @@ Int32 ke_delete_ke_heap(VoidPtr heapPtr) { virtualAddress->hCRC32 = 0; virtualAddress->hMagic = 0; + PTEWrapper pageWrapper(false, false, false, (UIntPtr)virtualAddress); + Ref<PTEWrapper*> pteAddress{ &pageWrapper }; + + kHeapPageManager.Free(pteAddress); + --kHeapCount; return 0; } |
