Defines sys_context_threadtls and other thread context specific functions. The defined functions are implemented inline to speed up performance.
LinuxSystemContext | Defines sys_context_threadtls and other thread context specific functions. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file LinuxSystemContext. |
C-kern/ | Included from header Konfiguration. |
thread_tls_t | |
Functions | |
sys_context_threadtls | Returns threadcontext_t of the current thread. |
sys_context2_threadtls | Returns threadcontext_t of the current thread. |
sys_size_threadtls | Returns the size in bytes of the thread local storage. |
sys_thread_threadtls | Returns current thread_t object. |
inline implementation | |
Macros | |
sys_context_threadtls | Implements thread_tls_t.sys_context_threadtls. |
sys_context2_threadtls | Implements thread_tls_t.sys_context2_threadtls. |
sys_size_threadtls | Implements thread_tls_t.sys_size_threadtls. |
sys_thread_threadtls | Implements thread_tls_t.sys_thread_threadtls. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2012 Jörg Seebohn
Header file LinuxSystemContext.
Included from header Konfiguration.
struct thread_tls_t
Functions | |
sys_context_threadtls | Returns threadcontext_t of the current thread. |
sys_context2_threadtls | Returns threadcontext_t of the current thread. |
sys_size_threadtls | Returns the size in bytes of the thread local storage. |
sys_thread_threadtls | Returns current thread_t object. |
struct threadcontext_t * sys_context_threadtls( void )
Returns threadcontext_t of the current thread. This function is called from all other functions using threadcontext_t. The returned pointer is calculated relative to the address of the current stack.
struct threadcontext_t * sys_context2_threadtls( void * local_var )
Returns threadcontext_t of the current thread. The parameter local_var must point to a local variable on the current stack. This function is called from sys_context_threadtls.
struct thread_t * sys_thread_threadtls( void )
Returns current thread_t object. Calls sys_context_threadtls and adds a constant offset.
#define sys_context_threadtls( ) ( __extension__ ({ int _addr ; sys_context2_threadtls( &_addr) ; }))
Implements thread_tls_t.sys_context_threadtls.
#define sys_context2_threadtls( local_var ) (threadcontext_t*) ( (uintptr_t)(local_var) & ~(uintptr_t) (sys_size_threadtls()-1) )
Implements thread_tls_t.sys_context2_threadtls.
#define sys_size_threadtls( ) (512*1024)
Implements thread_tls_t.sys_size_threadtls.
#define sys_thread_threadtls( ) ((thread_t*)(&sys_context_threadtls()[1]))
Implements thread_tls_t.sys_thread_threadtls.
Implements thread_tls_t.sys_context_threadtls.
#define sys_context_threadtls( ) ( __extension__ ({ int _addr ; sys_context2_threadtls( &_addr) ; }))
struct thread_tls_t
Returns threadcontext_t of the current thread.
struct threadcontext_t * sys_context_threadtls( void )
Returns threadcontext_t of the current thread.
struct threadcontext_t * sys_context2_threadtls( void * local_var )
Returns the size in bytes of the thread local storage.
size_t sys_size_threadtls( void )
Returns current thread_t object.
struct thread_t * sys_thread_threadtls( void )
Implements thread_tls_t.sys_context2_threadtls.
#define sys_context2_threadtls( local_var ) (threadcontext_t*) ( (uintptr_t)(local_var) & ~(uintptr_t) (sys_size_threadtls()-1) )
Implements thread_tls_t.sys_size_threadtls.
#define sys_size_threadtls( ) (512*1024)
Implements thread_tls_t.sys_thread_threadtls.
#define sys_thread_threadtls( ) ((thread_t*)(&sys_context_threadtls()[1]))