summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/KernelKit')
-rw-r--r--Kernel/KernelKit/ThreadLocalStorage.hxx6
-rw-r--r--Kernel/KernelKit/ThreadLocalStorage.inl7
2 files changed, 8 insertions, 5 deletions
diff --git a/Kernel/KernelKit/ThreadLocalStorage.hxx b/Kernel/KernelKit/ThreadLocalStorage.hxx
index 50c53fa4..41313381 100644
--- a/Kernel/KernelKit/ThreadLocalStorage.hxx
+++ b/Kernel/KernelKit/ThreadLocalStorage.hxx
@@ -21,7 +21,7 @@
/// Located in GS on AMD64, other architectures have their own stuff. (64x0, 32x0, ARM64)
struct PACKED ThreadInformationBlock final
{
- Kernel::Char Cookie[kTLSCookieLen];
+ Kernel::Char Cookie[kTLSCookieLen]; // Process cookie.
Kernel::UIntPtr StartCode; // Start Address
Kernel::UIntPtr StartData; // Allocation Heap
Kernel::UIntPtr StartStack; // Stack Pointer.
@@ -39,7 +39,7 @@ T* tls_new_ptr(void);
///! @brief delete ptr syscall.
template <typename T>
-bool tls_delete_ptr(T* ptr);
+Kernel::Boolean tls_delete_ptr(T* ptr);
template <typename T, typename... Args>
T* tls_new_class(Args&&... args);
@@ -52,6 +52,6 @@ EXTERN_C Kernel::Void tls_check_syscall_impl(Kernel::VoidPtr TIB) noexcept;
#include <KernelKit/ThreadLocalStorage.inl>
-// last rev 1/29/24
+// last rev 7/7/24
#endif /* ifndef _KERNELKIT_TLS_HPP */
diff --git a/Kernel/KernelKit/ThreadLocalStorage.inl b/Kernel/KernelKit/ThreadLocalStorage.inl
index c6e61059..319e71b3 100644
--- a/Kernel/KernelKit/ThreadLocalStorage.inl
+++ b/Kernel/KernelKit/ThreadLocalStorage.inl
@@ -25,7 +25,7 @@ inline T* tls_new_ptr(void)
//! @brief TLS delete implementation.
template <typename T>
-inline bool tls_delete_ptr(T* ptr)
+inline Kernel::Bool tls_delete_ptr(T* ptr)
{
if (!ptr)
return false;
@@ -64,8 +64,11 @@ T* tls_new_class(Args&&... args)
/// @param ptr
/// @return
template <typename T>
-inline bool tls_delete_class(T* ptr)
+inline Kernel::Bool tls_delete_class(T* ptr)
{
+ if (!ptr)
+ return false;
+
ptr->~T();
return tls_delete_ptr(ptr);
}