69 enum OSThreadAttributes
90 #define OS_CONTEXT_TAG 0x4F53436F6E747874ull
133 CHECK_OFFSET(
OSContext, 0x1b8, spinLockCount);
137 CHECK_OFFSET(
OSContext, 0x2e0, coretime);
138 CHECK_OFFSET(
OSContext, 0x2f8, starttime);
169 #define OS_THREAD_TAG 0x74487244u
191 UNKNOWN(0x35C - 0x338);
220 UNKNOWN(0x57c - 0x3a0);
225 UNKNOWN(0x5c0 - 0x5bc);
255 UNKNOWN(0x69c - 0x5f4);
258 CHECK_OFFSET(
OSThread, 0x324, state);
259 CHECK_OFFSET(
OSThread, 0x325, attr);
261 CHECK_OFFSET(
OSThread, 0x328, suspendCounter);
262 CHECK_OFFSET(
OSThread, 0x32c, priority);
263 CHECK_OFFSET(
OSThread, 0x330, basePriority);
264 CHECK_OFFSET(
OSThread, 0x334, exitValue);
265 CHECK_OFFSET(
OSThread, 0x35c, queue);
266 CHECK_OFFSET(
OSThread, 0x360, link);
267 CHECK_OFFSET(
OSThread, 0x368, joinQueue);
268 CHECK_OFFSET(
OSThread, 0x378, mutex);
269 CHECK_OFFSET(
OSThread, 0x37c, mutexQueue);
270 CHECK_OFFSET(
OSThread, 0x38c, activeLink);
271 CHECK_OFFSET(
OSThread, 0x394, stackStart);
272 CHECK_OFFSET(
OSThread, 0x398, stackEnd);
273 CHECK_OFFSET(
OSThread, 0x39c, entryPoint);
274 CHECK_OFFSET(
OSThread, 0x57c, specific);
275 CHECK_OFFSET(
OSThread, 0x5c0, name);
276 CHECK_OFFSET(
OSThread, 0x5c8, userStackPointer);
277 CHECK_OFFSET(
OSThread, 0x5cc, cleanupCallback);
278 CHECK_OFFSET(
OSThread, 0x5d0, deallocator);
279 CHECK_OFFSET(
OSThread, 0x5d4, cancelState);
280 CHECK_OFFSET(
OSThread, 0x5d8, requestFlag);
281 CHECK_OFFSET(
OSThread, 0x5dc, needSuspend);
282 CHECK_OFFSET(
OSThread, 0x5e0, suspendResult);
283 CHECK_OFFSET(
OSThread, 0x5e4, suspendQueue);
345 OSThreadAttributes attributes);
OSThreadCleanupCallbackFn cleanupCallback
Called just before thread is terminated, set with OSSetThreadCleanupCallback.
OSThreadDeallocatorFn deallocator
Called just after a thread is terminated, set with OSSetThreadDeallocator.
Allow the thread to run on CPU1.
void OSSetThreadSpecific(uint32_t id, uint32_t value)
int32_t priority
Actual priority of thread.
OSThreadLink link
Link used for thread queue.
OSThreadQueue * queue
Queue the thread is currently waiting on.
BOOL OSCreateThread(OSThread *thread, OSThreadEntryPointFn entry, int32_t argc, char *argv, void *stack, uint32_t stackSize, int32_t priority, OSThreadAttributes attributes)
int32_t OSCheckThreadStackUsage(OSThread *thread)
int32_t suspendCounter
Suspend count (increased by OSSuspendThread).
uint64_t tag
Should always be set to the value OS_CONTEXT_TAG.
OSThread * OSGetDefaultThread(uint32_t coreID)
int32_t basePriority
Base priority of thread, 0 is highest priority, 31 is lowest priority.
OSThread * OSGetCurrentThread()
int32_t OSGetThreadPriority(OSThread *thread)
void OSCancelThread(OSThread *thread)
Allow the thread to run any CPU.
const char * name
Thread name, accessed with OSSetThreadName and OSGetThreadName.
Thread is waiting, i.e. on a mutex.
void OSSleepTicks(OSTime ticks)
void * stackStart
Stack start (top, highest address)
void(* OSThreadDeallocatorFn)(OSThread *thread, void *stack)
Enables tracking of stack usage.
Allow the thread to run on CPU0.
BOOL OSIsThreadSuspended(OSThread *thread)
const char * OSGetThreadName(OSThread *thread)
int32_t exitValue
Exit value.
OSThreadLink activeLink
Link for global active thread queue.
BOOL OSSetThreadRunQuantum(OSThread *thread, uint32_t quantum)
uint32_t OSSuspendThread(OSThread *thread)
void OSDetachThread(OSThread *thread)
BOOL OSSetThreadCancelState(BOOL state)
int(* OSThreadEntryPointFn)(int argc, const char **argv)
BOOL OSSetThreadPriority(OSThread *thread, int32_t priority)
int32_t OSResumeThread(OSThread *thread)
int32_t needSuspend
Pending suspend request count.
OSMutex * mutex
Mutex this thread is waiting to lock.
uint32_t OSGetStackPointer()
BOOL cancelState
If TRUE then a thread can be cancelled or suspended, set with OSSetThreadCancelState.
void OSGetActiveThreadLink(OSThread *thread, OSThreadLink *link)
int32_t OSCheckActiveThreads()
void * stackEnd
Stack end (bottom, lowest address)
BOOL OSSetThreadAffinity(OSThread *thread, uint32_t affinity)
BOOL OSJoinThread(OSThread *thread, int *threadResult)
Allow the thread to run on CPU2.
void OSWakeupThread(OSThreadQueue *queue)
void OSContinueThread(OSThread *thread)
OSThreadRequest requestFlag
Current thread request, used for cancelleing and suspending the thread.
void OSSetThreadName(OSThread *thread, const char *name)
Start the thread detached.
uint32_t specific[0x10]
Thread specific values, accessed with OSSetThreadSpecific and OSGetThreadSpecific.
OSThreadEntryPointFn entryPoint
Thread entry point.
OSThreadQueue suspendQueue
Queue of threads waiting for a thread to be suspended.
BOOL OSSetThreadStackUsage(OSThread *thread)
void * userStackPointer
The stack pointer passed in OSCreateThread.
int32_t suspendResult
Result of thread suspend.
uint32_t OSGetThreadAffinity(OSThread *thread)
OSThreadQueue joinQueue
Queue of threads waiting to join this thread.
void OSSleepThread(OSThreadQueue *queue)
BOOL OSRunThread(OSThread *thread, OSThreadEntryPointFn entry, int argc, const char **argv)
void OSTestThreadCancel()
void OSExitThread(int32_t result)
OSThreadDeallocatorFn OSSetThreadDeallocator(OSThread *thread, OSThreadDeallocatorFn deallocator)
OSThreadCleanupCallbackFn OSSetThreadCleanupCallback(OSThread *thread, OSThreadCleanupCallbackFn callback)
Thread is about to terminate.
OSMutexQueue mutexQueue
Queue of mutexes this thread owns.
void(* OSThreadCleanupCallbackFn)(OSThread *thread, void *stack)
BOOL OSIsThreadTerminated(OSThread *thread)
uint32_t OSGetThreadSpecific(uint32_t id)
void OSClearThreadStackUsage(OSThread *thread)