From baf2afd8cd672dcb9c13d956dfdd73b61dfee558 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 19 Mar 2024 10:05:31 +0100 Subject: unstable, secret: See below. System.Core: - Add RunTime init function. - Add ReadMe.md Kernel: - Improve TLS code, use Encoder class instead of casting directly. - Refactor process team to include processscheduler.hpp instead. ObjectKit: - Rename Object.hxx to ObjectKit.hxx Builtins/AHCI: - Rename API.hxx to Interface.hxx Signed-off-by: Amlal El Mahrouss --- Private/KernelKit/ThreadLocalStorage.hxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'Private/KernelKit/ThreadLocalStorage.hxx') diff --git a/Private/KernelKit/ThreadLocalStorage.hxx b/Private/KernelKit/ThreadLocalStorage.hxx index 2fab5026..c6be2c2b 100644 --- a/Private/KernelKit/ThreadLocalStorage.hxx +++ b/Private/KernelKit/ThreadLocalStorage.hxx @@ -26,28 +26,21 @@ T *tls_new_class(Args &&...args); #define kTLSCookieLen 3 -typedef HCore::Char* rt_cookie_type; - -#define kTIBNameLen 256 - /// @brief Thread Information Block for Local Storage. /// Located in GS on AMD64, Virtual Address 0x10000 (64x0, 32x0, ARM64) -struct ThreadInformationBlock final { - HCore::Char Name[kTIBNameLen]; // Module Name +struct PACKED ThreadInformationBlock final { + HCore::Char Cookie[kTLSCookieLen]; HCore::UIntPtr StartCode; // Start Address HCore::UIntPtr StartData; // Allocation Heap HCore::UIntPtr StartStack; // Stack Pointer. - HCore::Int32 Arch; // Architecture and/or platform. - HCore::Int32 ID; // Thread execution ID. - rt_cookie_type Cookie; // Not shown in public header, location of the cookie header is store here, this is the way we tell - // something went wrong. + HCore::Int32 ThreadID; // Thread execution ID. }; /// @brief TLS install TIB EXTERN_C void rt_install_tib(ThreadInformationBlock *pTib, HCore::VoidPtr pPib); ///! @brief Cookie Sanity check. -HCore::Boolean tls_check_tib(ThreadInformationBlock *ptr); +HCore::Boolean tls_check_tib(ThreadInformationBlock* ptr); /// @brief TLS check system call EXTERN_C HCore::Void tls_check_syscall_impl(HCore::HAL::StackFramePtr stackPtr) noexcept; -- cgit v1.2.3