|
muteki
|
Kernel TLS (KTLS) control. More...
#include <muteki/threading.h>Go to the source code of this file.
Functions | |
| int | osdep_ktls_init (thread_t *thr) |
| Initialize the TLS container on a specific thread. | |
| void ** | osdep_ktls_get (thread_t *thr, unsigned int key) |
| Get the pointer to the TLS slot on the thread descriptor. | |
| void * | osdep_ktls_getvalue (thread_t *thr, unsigned int key) |
| Get the value stored in the TLS slot on the thread descriptor. | |
| int | osdep_ktls_set (thread_t *thr, unsigned int key, void *value) |
| Store a value in the TLS slot. | |
| void * | osdep_ktls_alloc (thread_t *thr, unsigned int key, size_t bytes) |
| Allocate memory and store the resulting pointer in the TLS slot. | |
| int | osdep_ktls_free (thread_t *thr, unsigned int key) |
| Free memory previously allocated by osdep_ktls_alloc(). | |
| int | osdep_ktls_init_self (void) |
| Initialize the TLS container on the current thread. | |
| void ** | osdep_ktls_get_self (unsigned int key) |
| Get the pointer to the TLS slot on the current thread. | |
| void * | osdep_ktls_getvalue_self (unsigned int key) |
| Get the value stored in a TLS slot of the current thread. | |
| int | osdep_ktls_set_self (unsigned int key, void *value) |
| Store a value in the TLS slot on the current thread. | |
| void * | osdep_ktls_alloc_self (unsigned int key, size_t bytes) |
| Allocate memory and store the resulting pointer in a TLS slot of the current thread. | |
| int | osdep_ktls_free_self (unsigned int key) |
| Free memory previously allocated by osdep_ktls_alloc(). | |
Kernel TLS (KTLS) control.
This is what TLSv1 used as the backend. Provided here in case one wants to hold data across applets/modules within the same thread.
|
extern |
Allocate memory and store the resulting pointer in the TLS slot.
| thr | Pointer to a thread descriptor. |
| key | Numerical key. Must be in the range of (0, 8). |
| bytes | Number of bytes to allocate. |
|
extern |
Allocate memory and store the resulting pointer in a TLS slot of the current thread.
| key | Numerical key. Must be in the range of (0, 8). |
| bytes | Number of bytes to allocate. |
|
extern |
Free memory previously allocated by osdep_ktls_alloc().
| thr | Pointer to a thread descriptor. |
| key | Numerical key. Must be in the range of (0, 8). |
| 0 | The operation was completed successfully. |
|
extern |
Free memory previously allocated by osdep_ktls_alloc().
| key | Numerical key. Must be in the range of (0, 8). |
| 0 | The operation was completed successfully. |
|
extern |
Get the pointer to the TLS slot on the thread descriptor.
| thr | Pointer to a thread descriptor. |
| key | Numerical key. Must be in the range of (0, 8). |
NULL when an invalid key was supplied.
|
extern |
Get the pointer to the TLS slot on the current thread.
| key | Numerical key. Must be in the range of (0, 8). |
NULL when an invalid key was supplied.
|
extern |
Get the value stored in the TLS slot on the thread descriptor.
| thr | Pointer to a thread descriptor. |
| key | Numerical key. Must be in the range of (0, 8). |
NULL when an error occurres.
|
extern |
Get the value stored in a TLS slot of the current thread.
| key | Numerical key. Must be in the range of (0, 8). |
|
extern |
Initialize the TLS container on a specific thread.
| thr | Pointer to a thread descriptor. |
| 0 | The operation was completed successfully. |
|
extern |
Initialize the TLS container on the current thread.
| 0 | The operation was completed successfully. |
|
extern |
Store a value in the TLS slot.
| thr | Pointer to a thread descriptor. |
| key | Numerical key. Must be in the range of (0, 8). |
| value | Value to be stored into the TLS slot. |
| 0 | The operation was completed successfully. |
| -1 | The operation failed with error. |
|
extern |
Store a value in the TLS slot on the current thread.
| key | Numerical key. Must be in the range of (0, 8). |
| value | Value to be stored into the TLS slot. |
| 0 | The operation was completed successfully. |
| -1 | The operation failed with error. |