NeKernel dev
Loading...
Searching...
No Matches
ThreadLocalStorage.h File Reference

Go to the source code of this file.

Classes

struct  THREAD_INFORMATION_BLOCK
 Thread Information Block. Located in GS on AMD64, other architectures have their own stuff. (64x0, 32x0, ARM64). More...

Macros

#define kCookieMag0Idx   (0U)
 !
#define kCookieMag1Idx   (1U)
#define kCookieMag2Idx   (2U)
#define kCookieMag0   'N'
#define kCookieMag1   'K'
#define kCookieMag2   'O'
#define kCookieMagLen   (3U)

Functions

Kernel::Boolean tls_check_tib (THREAD_INFORMATION_BLOCK *the_tib)
 !
template<typename T>
T * tls_new_ptr (void)
 !
template<typename T>
Kernel::Boolean tls_delete_ptr (T *ptr)
 !
template<typename T>
Kernel::Bool tls_delete_ptr (Kernel::ErrorOr< T > obj)
 Delete process pointer.
template<typename T>
Kernel::Bool tls_delete_ptr (Kernel::ErrorOr< T * > obj)
 Delete process pointer.
template<typename T, typename... Args>
T * tls_new_class (Args &&... args)
 Allocate a C++ class, and then call the constructor of it.
EXTERN_C Kernel::Void rt_install_tib (THREAD_INFORMATION_BLOCK *TIB, THREAD_INFORMATION_BLOCK *PIB)
 TLS install TIB and PIB. (syscall).
EXTERN_C Kernel::Bool tls_check_syscall_impl (Kernel::VoidPtr TIB)
 TLS check (syscall).

Macro Definition Documentation

◆ kCookieMag0

#define kCookieMag0   'N'

◆ kCookieMag0Idx

#define kCookieMag0Idx   (0U)

!

Thread Local Storage for NeKernel.

◆ kCookieMag1

#define kCookieMag1   'K'

◆ kCookieMag1Idx

#define kCookieMag1Idx   (1U)

◆ kCookieMag2

#define kCookieMag2   'O'

◆ kCookieMag2Idx

#define kCookieMag2Idx   (2U)

◆ kCookieMagLen

#define kCookieMagLen   (3U)

Function Documentation

◆ rt_install_tib()

TLS install TIB and PIB. (syscall).

◆ tls_check_syscall_impl()

EXTERN_C Kernel::Bool tls_check_syscall_impl ( Kernel::VoidPtr tib_ptr)

TLS check (syscall).

TLS check (syscall).

Parameters
tib_ptrThe TIB record.
Returns
if the TIB record is valid or not.

◆ tls_check_tib()

Kernel::Boolean tls_check_tib ( THREAD_INFORMATION_BLOCK * tib_ptr)

!

Cookie Sanity check.

!

Parameters
tib_ptrthe TIB to check.
Returns
if the cookie is enabled, true; false otherwise

◆ tls_delete_ptr() [1/3]

template<typename T>
Kernel::Bool tls_delete_ptr ( Kernel::ErrorOr< T * > obj)
inline

Delete process pointer.

Parameters
objThe pointer to delete.

◆ tls_delete_ptr() [2/3]

template<typename T>
Kernel::Bool tls_delete_ptr ( Kernel::ErrorOr< T > obj)
inline

Delete process pointer.

Parameters
objThe pointer to delete.

◆ tls_delete_ptr() [3/3]

template<typename T>
Kernel::Boolean tls_delete_ptr ( T * obj)
inline

!

delete ptr syscall.

!

Parameters
objThe pointer to delete.

◆ tls_new_class()

template<typename T, typename... Args>
T * tls_new_class ( Args &&... args)

Allocate a C++ class, and then call the constructor of it.

Template Parameters
Tclass type.
...Argsvarg class type.
Parameters
argsarguments list.
Returns
Class instance.

◆ tls_new_ptr()

template<typename T>
T * tls_new_ptr ( void )
inline

!

new ptr syscall.