From 15d5949e85216a14715e64ed5116e999d6869558 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 9 Jan 2024 21:28:33 +0100 Subject: kernel/tls: Improvements on the kernel side. hal: remove NewCPU and add 64x0, for it's future support. Signed-off-by: Amlal El Mahrouss --- KernelKit/ThreadLocalStorage.hxx | 4 ++-- KernelKit/ThreadLocalStorage.inl | 48 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'KernelKit') diff --git a/KernelKit/ThreadLocalStorage.hxx b/KernelKit/ThreadLocalStorage.hxx index c5030972..8d84befb 100644 --- a/KernelKit/ThreadLocalStorage.hxx +++ b/KernelKit/ThreadLocalStorage.hxx @@ -14,9 +14,9 @@ //! @brief TLS implementation in C++ -#define kRTLMag0 'V' +#define kRTLMag0 'h' #define kRTLMag1 'C' -#define kRTLMag2 'S' +#define kRTLMag2 'o' template T* hcore_tls_new_ptr(void); diff --git a/KernelKit/ThreadLocalStorage.inl b/KernelKit/ThreadLocalStorage.inl index c117dd4e..bf036366 100644 --- a/KernelKit/ThreadLocalStorage.inl +++ b/KernelKit/ThreadLocalStorage.inl @@ -12,39 +12,39 @@ template inline T* hcore_tls_new_ptr(void) { - using namespace hCore; - - auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); - - T* pointer = (T*)ref_process.Leak().New(sizeof(T)); - return pointer; + using namespace hCore; + + auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); + + T* pointer = (T*)ref_process.Leak().New(sizeof(T)); + return pointer; } //! @brief TLS delete implementation. template inline bool hcore_tls_delete_ptr(T* ptr) { - if (!ptr) - return false; - - using namespace hCore; - - auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); - ptr->~T(); - - return ref_process.Leak().Delete(ptr, sizeof(T)); + if (!ptr) + return false; + + using namespace hCore; + + auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); + ptr->~T(); + + return ref_process.Leak().Delete(ptr, sizeof(T)); } template T* hcore_tls_new_class(Args&&... args) { - T* ptr = hcore_tls_new_ptr(); - - if (ptr) - { - *ptr = T(hCore::forward(args)...); - return ptr; - } - - return nullptr; + T* ptr = hcore_tls_new_ptr(); + + if (ptr) + { + *ptr = T(hCore::forward(args)...); + return ptr; + } + + return nullptr; } -- cgit v1.2.3