|
muteki
|
Thread descriptor structure. More...
#include <threading.h>
Data Fields | ||
| int | magic | |
| uintptr_t * | sp | |
| void * | stack | |
| int | exit_code | |
| kerrno_t | kerrno | |
| uintptr_t | unk_0x14 | |
| thread_func_t | thread_func | |
| short | unk_0x1c | |
| short | sleep_counter | |
| short | wait_reason | |
| short | slot | |
| char | slot_low3b | |
| char | slot_high3b | |
| unsigned char | slot_low3b_bit | |
| unsigned char | slot_high3b_bit | |
| event_t * | event | |
| thread_t * | prev | |
| thread_t * | next | |
| union { | ||
| char unk_0x34 [0x20] | ||
| uintptr_t ktls [8] | ||
| }; | ||
Thread descriptor structure.
| event_t* thread_s::event |
Event descriptor that belongs to the event the thread is currently waiting for.
| int thread_s::exit_code |
Exit code of the thread. Initializes to 0.
| kerrno_t thread_s::kerrno |
Error code.
| uintptr_t thread_s::ktls[8] |
Kernel TLS (reusing the seemingly unused unk_0x34 fields)
| int thread_s::magic |
Magic. Always 0x100.
| thread_t* thread_s::next |
Next thread descriptor.
| thread_t* thread_s::prev |
Previous thread descriptor.
| short thread_s::sleep_counter |
Milliseconds left to sleep.
| short thread_s::slot |
Slot number. For scheduler.
| char thread_s::slot_high3b |
Upper 3 bit of the slot number. For scheduler.
| unsigned char thread_s::slot_high3b_bit |
Upper 3 bit bitmask of the slot number. For scheduler.
| char thread_s::slot_low3b |
Lower 3 bit of the slot number. For scheduler.
| unsigned char thread_s::slot_low3b_bit |
Lower 3 bit bitmask of the slot number. For scheduler.
| uintptr_t* thread_s::sp |
Stack pointer. When the thread is suspended this will point to the CPU context saved on thread stack.
| void* thread_s::stack |
Allocated stack memory.
| thread_func_t thread_s::thread_func |
Thread function entrypoint.
| uintptr_t thread_s::unk_0x14 |
Unknown. Initializes to 0x80000000.
| short thread_s::unk_0x1c |
Unknown.
| char thread_s::unk_0x34[0x20] |
Unknown and seems to be uninitialized.
| short thread_s::wait_reason |
Current wait reason of the thread.