Line 182:
Line 182:
|OSGetCurrentThread
|OSGetCurrentThread
|<code>OSThread *OSGetCurrentThread(void)</code>
|<code>OSThread *OSGetCurrentThread(void)</code>
β
|Get the OSThread structure ptr for the current thread.
+
|Get the OSThread structure ptr for the current thread
+
|-
+
|OSSetThreadName
+
|<code>void OSSetThreadName(OSThread *thread, char *name)</code>
+
|Sets a new name for the thread
|-
|-
|OSGetThreadName
|OSGetThreadName
Line 190:
Line 194:
|OSSetThreadAffinity
|OSSetThreadAffinity
|<code>uint32_t OSSetThreadAffinity(OSThread* thread, int16_t affinity)</code>
|<code>uint32_t OSSetThreadAffinity(OSThread* thread, int16_t affinity)</code>
β
|Sets the affinity for the specified thread. Returns 0 for failure, 1 for success.
+
|Sets the affinity for the specified thread. Returns 0 for failure, 1 for success
|-
|-
|OSGetCoreId
|OSGetCoreId
|<code>uint32_t OSGetCoreId(void)</code>
|<code>uint32_t OSGetCoreId(void)</code>
β
|Returns the PowerPC coreid this code is running on(value of spr1007).
+
|Returns the PowerPC coreid this code is running on(value of spr1007)
|-
|-
|OSGetStackPointer
|OSGetStackPointer
|<code>uint32_t *OSGetStackPointer(void)</code>
|<code>uint32_t *OSGetStackPointer(void)</code>
β
|Returns the r1 register(aka "sp").
+
|Returns the r1 register(aka "sp")
|-
|-
|OSSwitchStack
|OSSwitchStack
|<code>void OSSwitchStack(uint32_t *stackptr)</code>
|<code>void OSSwitchStack(uint32_t *stackptr)</code>
β
|This basically sets the current thread's r1(aka sp) to the input address, and also calls internal coreinit functions with input_param=input_stackptr. Note that this overwrites data near the start of the specified address due to stack push/pop. This will return to the address LR was set to at function entry.
+
|This basically sets the current thread's r1(aka sp) to the input address, and also calls internal coreinit functions with input_param=input_stackptr. Note that this overwrites data near the start of the specified address due to stack push/pop. This will return to the address LR was set to at function entry
|}
|}