diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
| commit | 83d870e58457a1d335a1d9b9966a6a1887cc297b (patch) | |
| tree | 72888f88c7728c82f3f6df1f4f70591de15eab36 /dev/kernel/src/ThreadLocalStorage.cc | |
| parent | ab37adbacf0f33845804c788b39680cd754752a8 (diff) | |
feat! breaking changes on kernel sources.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/ThreadLocalStorage.cc')
| -rw-r--r-- | dev/kernel/src/ThreadLocalStorage.cc | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/dev/kernel/src/ThreadLocalStorage.cc b/dev/kernel/src/ThreadLocalStorage.cc deleted file mode 100644 index fa445d84..00000000 --- a/dev/kernel/src/ThreadLocalStorage.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ======================================================== - * - * NeKernel - * Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - * - * ======================================================== - */ - -#include <CFKit/Property.h> -#include <KernelKit/ProcessScheduler.h> -#include <KernelKit/ThreadLocalStorage.h> -#include <NeKit/KString.h> - -/***********************************************************************************/ -/// @bugs: 0 -/// @file ThreadLocalStorage.cc -/// @brief NeKernel Thread Local Storage. -///! @author Amlal El Mahrouss (amlal@nekernel.org) -/***********************************************************************************/ - -using namespace Kernel; - -/** - * @brief Checks for cookie inside the TIB. - * @param tib_ptr the TIB to check. - * @return if the cookie is enabled, true; false otherwise - */ - -Boolean tls_check_tib(THREAD_INFORMATION_BLOCK* tib_ptr) { - if (!tib_ptr) return false; - - return tib_ptr->Cookie[kCookieMag0Idx] == kCookieMag0 && - tib_ptr->Cookie[kCookieMag1Idx] == kCookieMag1 && - tib_ptr->Cookie[kCookieMag2Idx] == kCookieMag2; -} - -/** - * @brief System call implementation of the TLS check. - * @param tib_ptr The TIB record. - * @return if the TIB record is valid or not. - */ -EXTERN_C Bool tls_check_syscall_impl(Kernel::VoidPtr tib_ptr) noexcept { - if (!tib_ptr) { - kout << "TLS: Failed because of an invalid TIB...\r"; - return No; - } - - THREAD_INFORMATION_BLOCK* tib = reinterpret_cast<THREAD_INFORMATION_BLOCK*>(tib_ptr); - - return tls_check_tib(tib); -} |
