Multi-threading: Difference between revisions

Neobrain (talk | contribs)
No edit summary
Neobrain (talk | contribs)
mNo edit summary
Line 20: Line 20:
'''svc''' : 0x08
'''svc''' : 0x08


'''Declaration'''
'''Signature'''
  Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid);
  Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid);


Line 49: Line 49:
'''svc''' : 0x09
'''svc''' : 0x09


'''Declaration'''
'''Signature'''
  void ExitThread(void);
  void ExitThread(void);


Line 55: Line 55:
'''svc''' : 0x0A
'''svc''' : 0x0A


'''Declaration'''
'''Signature'''
  void SleepThread(s64 nanoseconds);
  void SleepThread(s64 nanoseconds);


Line 61: Line 61:
'''svc''' : 0x0B
'''svc''' : 0x0B


'''Declaration'''
'''Signature'''
  Result GetThreadPriority(s32* priority, Handle thread);
  Result GetThreadPriority(s32* priority, Handle thread);


Line 77: Line 77:
'''svc''' : 0x0C
'''svc''' : 0x0C


'''Declaration'''
'''Signature'''
  Result SetThreadPriority(Handle thread, s32 priority);
  Result SetThreadPriority(Handle thread, s32 priority);


Line 83: Line 83:
'''svc''' : 0x34
'''svc''' : 0x34


'''Declaration'''
'''Signature'''
  Result OpenThread(Handle* thread, Handle process, u32 threadId);
  Result OpenThread(Handle* thread, Handle process, u32 threadId);


Line 89: Line 89:
'''svc''' : 0x36
'''svc''' : 0x36


'''Declaration'''
'''Signature'''
  Result GetProcessIdOfThread(u32* processId, Handle thread);
  Result GetProcessIdOfThread(u32* processId, Handle thread);


Line 95: Line 95:
'''svc''' : 0x37
'''svc''' : 0x37


'''Declaration'''
'''Signature'''
  Result GetThreadId(u32* threadId, Handle thread);
  Result GetThreadId(u32* threadId, Handle thread);


Line 104: Line 104:
'''svc''' : 0x2C
'''svc''' : 0x2C


'''Declaration'''
'''Signature'''
  Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type);
  Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type);


Line 114: Line 114:
'''svc''' : 0x3B
'''svc''' : 0x3B


'''Declaration'''
'''Signature'''
  Result GetThreadContext(ThreadContext* context, Handle thread);
  Result GetThreadContext(ThreadContext* context, Handle thread);


Line 127: Line 127:
'''svc''' : 0x0D
'''svc''' : 0x0D


'''Declaration'''
'''Signature'''
  Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);
  Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);


Line 133: Line 133:
'''svc''' : 0x0E
'''svc''' : 0x0E


'''Declaration'''
'''Signature'''
  Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);
  Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);


Line 139: Line 139:
'''svc''' : 0x0F
'''svc''' : 0x0F


'''Declaration'''
'''Signature'''
  Result GetThreadIdealProcessor(s32* processorid, Handle thread);
  Result GetThreadIdealProcessor(s32* processorid, Handle thread);