libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
tls.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include<libtransistor/types.h>
13 #include<libtransistor/thread.h>
14 
15 #include<reent.h>
16 #include<stdint.h>
17 
18 struct tls {
19  uint32_t ipc_buffer[0x100/sizeof(uint32_t)];
20  uint8_t _unk1[0xF8];
21  trn_thread_t *thread;
22 };
23 
27 struct tls *get_tls();
28 
33 
38 
39 #ifdef __cplusplus
40 }
41 #endif
Various system types.
struct tls * get_tls()
Gets the address of the thread-local storage.
handle_t thread_h
Thread handle.
Definition: types.h:39
thread_h get_thread_handle()
Gets the current thread's handle, or 0xFFFFFFFF if called before threads have been fully initialized...
Threading functions.
trn_thread_t * trn_get_thread()
Gets the current thread struct.
Definition: thread.h:15
Definition: tls.h:18