summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-18 13:04:01 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-18 13:04:11 +0200
commit90faf32f29b5482b52ab90f416528ed8f4e8f130 (patch)
tree7c4c08d0d07a2ae148434b9ef508ec752e7274a8 /Kernel/KernelKit
parent1a3b924f62346cc76bd183883825c5541834c90c (diff)
MHR-31
IMP: Add TLS, a new/delete syscall. TODO: File I/O and network syscalls as well. Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/KernelKit')
-rw-r--r--Kernel/KernelKit/ThreadLocalStorage.hxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/Kernel/KernelKit/ThreadLocalStorage.hxx b/Kernel/KernelKit/ThreadLocalStorage.hxx
index 9d5473a2..75d29ced 100644
--- a/Kernel/KernelKit/ThreadLocalStorage.hxx
+++ b/Kernel/KernelKit/ThreadLocalStorage.hxx
@@ -15,16 +15,7 @@
#define kCookieMag1 'C'
#define kCookieMag2 'R'
-template <typename T>
-T* tls_new_ptr(void);
-
-template <typename T>
-bool tls_delete_ptr(T* ptr);
-
-template <typename T, typename... Args>
-T* tls_new_class(Args&&... args);
-
-#define kTLSCookieLen 3
+#define kTLSCookieLen (3U)
/// @brief Thread Information Block for Local Storage.
/// Located in GS on AMD64, other architectures have their own stuff. (64x0, 32x0, ARM64)
@@ -39,13 +30,24 @@ struct PACKED ThreadInformationBlock final
typedef struct ThreadInformationBlock ProcessInformationBlock;
-/// @brief TLS install TIB and PIB.
-EXTERN_C void rt_install_tib(ThreadInformationBlock* TIB, ThreadInformationBlock* PIB);
-
///! @brief Cookie Sanity check.
NewOS::Boolean tls_check_tib(ThreadInformationBlock* Ptr);
-/// @brief TLS check system call
+///! @brief new ptr syscall.
+template <typename T>
+T* tls_new_ptr(void);
+
+///! @brief delete ptr syscall.
+template <typename T>
+bool tls_delete_ptr(T* ptr);
+
+template <typename T, typename... Args>
+T* tls_new_class(Args&&... args);
+
+/// @brief TLS install TIB and PIB. (syscall)
+EXTERN_C void rt_install_tib(ThreadInformationBlock* TIB, ThreadInformationBlock* PIB);
+
+/// @brief TLS check (syscall)
EXTERN_C NewOS::Void tls_check_syscall_impl(NewOS::VoidPtr TIB) noexcept;
#include <KernelKit/ThreadLocalStorage.inl>