KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Compiler Thread-local storage. More...
Go to the source code of this file.
Functions | |
void | arch_tls_init (void) |
Initialize tls. | |
bool | arch_tls_setup_data (kthread_t *thd) |
Set up tls data for a new kthread. | |
void | arch_tls_destroy_data (kthread_t *thd) |
Destroy tls data for an old kthread. | |
Compiler Thread-local storage.
The functions in this file deal with managing static TLS for C99's __thread or C11's _Thread_local.
This should not be exported or accessed externally.
void arch_tls_destroy_data | ( | kthread_t * | thd | ) |
Destroy tls data for an old kthread.
This function undoes arch_tls_setup_data.
It will be called by thd_destroy
thd | The thread to destroy tls data for. |
void arch_tls_init | ( | void | ) |
Initialize tls.
This function takes the steps necessary to initialize tls after the creation of the k_thread for the main kernel thread.
For SH, this forces the setting of the GBR register to the TLS of the kernel thread. That isn't necessary afterwards as it is handled during context switching.
bool arch_tls_setup_data | ( | kthread_t * | thd | ) |
Set up tls data for a new kthread.
This function allocates the memory for a kthread's TLS, copies static data from the executable, and sets the kthread's IRQ context to match.
It will be called by thd_create_ex
thd | The thread to setup tls data for. |