Multi-threading: Difference between revisions
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
== Usage == | == Usage == | ||
=== CreateThread | === CreateThread === | ||
'''svc''' : 0x08 | |||
'''Definition''' | '''Definition''' | ||
Line 45: | Line 46: | ||
The input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0. | The input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0. | ||
=== ExitThread | === ExitThread === | ||
'''svc''' : 0x09 | |||
'''Definition''' | '''Definition''' | ||
void ExitThread(void); | void ExitThread(void); | ||
=== SleepThread | === SleepThread === | ||
'''svc''' : 0x0A | |||
'''Definition''' | '''Definition''' | ||
void SleepThread(s64 nanoseconds); | void SleepThread(s64 nanoseconds); | ||
=== GetThreadPriority | === GetThreadPriority === | ||
'''svc''' : 0x0B | |||
'''Definition''' | '''Definition''' | ||
Line 70: | Line 74: | ||
bx lr | bx lr | ||
=== SetThreadPriority | === SetThreadPriority === | ||
'''svc''' : 0x0C | |||
'''Definition''' | '''Definition''' | ||
Result SetThreadPriority(Handle thread, s32 priority); | Result SetThreadPriority(Handle thread, s32 priority); | ||
=== OpenThread | === OpenThread === | ||
'''svc''' : 0x34 | |||
'''Definition''' | '''Definition''' | ||
Result OpenThread(Handle* thread, Handle process, u32 threadId); | Result OpenThread(Handle* thread, Handle process, u32 threadId); | ||
=== GetProcessIdOfThread | === GetProcessIdOfThread === | ||
'''svc''' : 0x36 | |||
'''Definition''' | '''Definition''' | ||
Result GetProcessIdOfThread(u32* processId, Handle thread); | Result GetProcessIdOfThread(u32* processId, Handle thread); | ||
=== GetThreadId | === GetThreadId === | ||
'''svc''' : 0x37 | |||
'''Definition''' | '''Definition''' | ||
Result GetThreadId(u32* threadId, Handle thread); | Result GetThreadId(u32* threadId, Handle thread); | ||
=== GetThreadInfo | === GetThreadInfo === | ||
'''svc''' : 0x2C | |||
'''Definition''' | '''Definition''' | ||
Line 103: | Line 112: | ||
|} | |} | ||
=== GetThreadContext | === GetThreadContext === | ||
'''svc''' : 0x3B | |||
'''Definition''' | '''Definition''' | ||
Line 113: | Line 123: | ||
== Core affinity == | == Core affinity == | ||
=== GetThreadAffinityMask | === GetThreadAffinityMask === | ||
'''svc''' : 0x0D | |||
'''Definition''' | '''Definition''' | ||
Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount); | Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount); | ||
=== SetThreadAffinityMask | === SetThreadAffinityMask === | ||
'''svc''' : 0x0E | |||
'''Definition''' | '''Definition''' | ||
Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount); | Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount); | ||
=== GetThreadIdealProcessor | === GetThreadIdealProcessor === | ||
'''svc''' : 0x0F | |||
'''Definition''' | '''Definition''' | ||
Result GetThreadIdealProcessor(s32* processorid, Handle thread); | Result GetThreadIdealProcessor(s32* processorid, Handle thread); | ||
=== SetThreadIdealProcessor | === SetThreadIdealProcessor === | ||
'''svc''' : 0x10 | |||
== Debug == | == Debug == |