From 596268586bb4c8248a8ec106b8cdea12b9ab926a Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Tue, 18 Jun 2024 10:39:00 +0200 Subject: IMP: TLS syscall, serial write syscall. FIX: SMP manager writes to stack frame directly, check if we also want to free the stack. Signed-off-by: Amlal EL Mahrouss --- Kernel/Sources/ThreadLocalStorage.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Kernel/Sources/ThreadLocalStorage.cxx') diff --git a/Kernel/Sources/ThreadLocalStorage.cxx b/Kernel/Sources/ThreadLocalStorage.cxx index c292d078..4d6fec14 100644 --- a/Kernel/Sources/ThreadLocalStorage.cxx +++ b/Kernel/Sources/ThreadLocalStorage.cxx @@ -44,14 +44,16 @@ Boolean tls_check_tib(ThreadInformationBlock* tib) * @param stackPtr The call frame. * @return */ -EXTERN_C Void tls_check_syscall_impl(NewOS::HAL::StackFramePtr stackPtr) noexcept +EXTERN_C Void tls_check_syscall_impl(NewOS::VoidPtr TIB) noexcept { - ThreadInformationBlock* tib = (ThreadInformationBlock*)stackPtr->Gs; + if (!TIB) return; + + ThreadInformationBlock* tib = (ThreadInformationBlock*)TIB; if (!tls_check_tib(tib)) { kcout << "newoskrnl: Verification failed, Crashing...\r"; - ProcessScheduler::The().Leak().GetCurrent().Leak().Crash(); + ProcessScheduler::The().Leak().TheCurrent().Leak().Crash(); } kcout << "newoskrnl: Verification succeeded! Keeping on...\r"; -- cgit v1.2.3