diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 12:05:27 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 12:05:27 +0100 |
| commit | d6bc3461106b9c8f0f29b4eea487ff59b0cc6206 (patch) | |
| tree | 82630d94b81dac8504acb54a62c2d51975b7cc93 /Private/Source/ThreadLocalStorage.cxx | |
| parent | de4af9d8929da048ab714b75d2af23ccebe3f6cb (diff) | |
KernelKit: SMP: Fix SMPManager::Switch (IsBusy())
KernelKit: TLS: Refactor and add documentation to it.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/ThreadLocalStorage.cxx')
| -rw-r--r-- | Private/Source/ThreadLocalStorage.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx index 5d231f61..bcafdd10 100644 --- a/Private/Source/ThreadLocalStorage.cxx +++ b/Private/Source/ThreadLocalStorage.cxx @@ -12,15 +12,28 @@ using namespace hCore; +/** + * Check for cookie inside TIB. + * @param ptr + * @return if the cookie is enabled. + */ Boolean hcore_tls_check(VoidPtr ptr) { if (!ptr) return false; - const char *_ptr = (const char *)ptr; - return _ptr[0] == kRTLMag0 && _ptr[1] == kRTLMag1 && _ptr[2] == kRTLMag2; + const char* _ptr = (const char*)ptr; + + kcout << "TLS: Check for cookie...\n"; + + return _ptr[0] == kCookieMag0 && _ptr[1] == kCookieMag1 && _ptr[2] == kCookieMag2; } +/** + * System call implementation in hCore + * @param ptr + * @return + */ Void hcore_tls_check_syscall_impl(ThreadInformationBlock ptr) noexcept { if (!hcore_tls_check(ptr.Cookie)) |
