wut
1.0.0-beta9
Wii U Toolchain
|
Go to the documentation of this file.
102 WUT_UNKNOWN_BYTES(4);
118 #define OS_THREAD_TAG 0x74487244u
119 #pragma pack(push, 1)
137 int32_t suspendCounter;
143 int32_t basePriority;
148 WUT_UNKNOWN_BYTES(0x35C - 0x338);
177 WUT_UNKNOWN_BYTES(0x57c - 0x3a0);
180 void *specific[0x10];
182 WUT_UNKNOWN_BYTES(0x5c0 - 0x5bc);
187 WUT_UNKNOWN_BYTES(0x4);
190 void *userStackPointer;
208 int32_t suspendResult;
213 WUT_UNKNOWN_BYTES(0x6a0 - 0x5f4);
216 WUT_CHECK_OFFSET(
OSThread, 0x320, tag);
217 WUT_CHECK_OFFSET(
OSThread, 0x324, state);
218 WUT_CHECK_OFFSET(
OSThread, 0x325, attr);
219 WUT_CHECK_OFFSET(
OSThread, 0x326,
id);
220 WUT_CHECK_OFFSET(
OSThread, 0x328, suspendCounter);
221 WUT_CHECK_OFFSET(
OSThread, 0x32c, priority);
222 WUT_CHECK_OFFSET(
OSThread, 0x330, basePriority);
223 WUT_CHECK_OFFSET(
OSThread, 0x334, exitValue);
224 WUT_CHECK_OFFSET(
OSThread, 0x35c, queue);
225 WUT_CHECK_OFFSET(
OSThread, 0x360, link);
226 WUT_CHECK_OFFSET(
OSThread, 0x368, joinQueue);
227 WUT_CHECK_OFFSET(
OSThread, 0x378, mutex);
228 WUT_CHECK_OFFSET(
OSThread, 0x37c, mutexQueue);
229 WUT_CHECK_OFFSET(
OSThread, 0x38c, activeLink);
230 WUT_CHECK_OFFSET(
OSThread, 0x394, stackStart);
231 WUT_CHECK_OFFSET(
OSThread, 0x398, stackEnd);
232 WUT_CHECK_OFFSET(
OSThread, 0x39c, entryPoint);
233 WUT_CHECK_OFFSET(
OSThread, 0x57c, specific);
234 WUT_CHECK_OFFSET(
OSThread, 0x5c0, name);
235 WUT_CHECK_OFFSET(
OSThread, 0x5c8, userStackPointer);
236 WUT_CHECK_OFFSET(
OSThread, 0x5cc, cleanupCallback);
237 WUT_CHECK_OFFSET(
OSThread, 0x5d0, deallocator);
238 WUT_CHECK_OFFSET(
OSThread, 0x5d4, cancelState);
239 WUT_CHECK_OFFSET(
OSThread, 0x5d8, requestFlag);
240 WUT_CHECK_OFFSET(
OSThread, 0x5dc, needSuspend);
241 WUT_CHECK_OFFSET(
OSThread, 0x5e0, suspendResult);
242 WUT_CHECK_OFFSET(
OSThread, 0x5e4, suspendQueue);
void(* OSThreadCleanupCallbackFn)(OSThread *thread, void *stack)
BOOL OSSetThreadCancelState(BOOL state)
Set a thread's cancellation state.
@ OS_THREAD_ATTRIB_AFFINITY_CPU1
Allow the thread to run on CPU1.
int(* OSThreadEntryPointFn)(int argc, const char **argv)
@ OS_THREAD_REQUEST_CANCEL
void OSWakeupThread(OSThreadQueue *queue)
Wake up all threads in queue.
BOOL OSSetThreadRunQuantum(OSThread *thread, uint32_t quantum)
Set a thread's run quantum.
void OSSleepThread(OSThreadQueue *queue)
Sleep the current thread and add it to a thread queue.
OSThreadDeallocatorFn OSSetThreadDeallocator(OSThread *thread, OSThreadDeallocatorFn deallocator)
Set the callback to be called just after a thread is terminated.
void OSExitThread(int32_t result)
Exit the current thread with a exit code.
struct WUT_ALIGNAS(8) OSThread
@ OS_THREAD_STATE_RUNNING
Thread is running.
BOOL OSSetThreadAffinity(OSThread *thread, uint32_t affinity)
Set a thread's affinity.
BOOL OSJoinThread(OSThread *thread, int *threadResult)
Wait until thread is terminated.
@ OS_THREAD_REQUEST_SUSPEND
uint32_t OSThreadRequest
A value from enum OS_THREAD_REQUEST.
@ OS_THREAD_ATTRIB_DETACHED
Start the thread detached.
void OSSetThreadName(OSThread *thread, const char *name)
Set a thread's name.
void OSSleepTicks(OSTime ticks)
Sleep the current thread for a period of time.
struct OSContext OSContext
void OSSetThreadSpecific(uint32_t id, void *value)
Set a thread specific value.
void OSTestThreadCancel()
Check to see if the current thread should be cancelled or suspended.
OSThreadCleanupCallbackFn OSSetThreadCleanupCallback(OSThread *thread, OSThreadCleanupCallbackFn callback)
Set the callback to be called just before a thread is terminated.
@ OS_THREAD_ATTRIB_AFFINITY_ANY
Allow the thread to run any CPU.
BOOL OSIsThreadTerminated(OSThread *thread)
Returns TRUE if a thread is terminated.
BOOL OSCreateThread(OSThread *thread, OSThreadEntryPointFn entry, int32_t argc, char *argv, void *stack, uint32_t stackSize, int32_t priority, OSThreadAttributes attributes)
Create a new thread.
int32_t OSCheckThreadStackUsage(OSThread *thread)
Get the maximum amount of stack the thread has used.
OSThread * OSGetDefaultThread(uint32_t coreID)
Returns the default thread for a specific core.
uint32_t OSSuspendThread(OSThread *thread)
Suspend a thread.
int32_t OSGetThreadPriority(OSThread *thread)
Get a thread's base priority.
uint8_t OSThreadAttributes
A bitfield of enum OS_THREAD_ATTRIB.
@ OS_THREAD_ATTRIB_AFFINITY_CPU0
Allow the thread to run on CPU0.
BOOL OSRunThread(OSThread *thread, OSThreadEntryPointFn entry, int argc, const char **argv)
Run a function on an already created thread.
@ OS_THREAD_ATTRIB_AFFINITY_CPU2
Allow the thread to run on CPU2.
void OSGetActiveThreadLink(OSThread *thread, OSThreadLink *link)
Get the next and previous thread in the thread's active queue.
void OSCancelThread(OSThread *thread)
Cancels a thread.
void OSDetachThread(OSThread *thread)
Detach thread.
BOOL OSSetThreadPriority(OSThread *thread, int32_t priority)
Set a thread's priority.
void OSClearThreadStackUsage(OSThread *thread)
Disable tracking of thread stack usage.
uint32_t OSGetThreadAffinity(OSThread *thread)
Get a thread's affinity.
void(* OSThreadDeallocatorFn)(OSThread *thread, void *stack)
@ OS_THREAD_STATE_WAITING
Thread is waiting, i.e. on a mutex.
@ OS_THREAD_STATE_MORIBUND
Thread is about to terminate.
uint32_t OSGetStackPointer()
Return current stack pointer, value of r1 register.
OSThread * OSGetCurrentThread()
Return pointer to OSThread object for the current thread.
uint8_t OSThreadState
A value from enum OS_THREAD_STATE.
int32_t OSResumeThread(OSThread *thread)
Resumes a thread.
BOOL OSIsThreadSuspended(OSThread *thread)
Returns TRUE if a thread is suspended.
const char * OSGetThreadName(OSThread *thread)
Get a thread's name.
void OSYieldThread()
Yield execution to waiting threads with same priority.
@ OS_THREAD_ATTRIB_STACK_USAGE
Enables tracking of stack usage.
void OSContinueThread(OSThread *thread)
Clears a thread's suspend counter and resumes it.
void * OSGetThreadSpecific(uint32_t id)
Get a thread's specific value set by OSSetThreadSpecific.
int32_t OSCheckActiveThreads()
Returns the count of active threads.
@ OS_THREAD_STATE_READY
Thread is ready to run.
BOOL OSSetThreadStackUsage(OSThread *thread)
Set thread stack usage tracking.