USERBREAK_USER = 2
} UserBreakType;
+/**
+* Type of the query for svcGetThreadInfo
+*/
+typedef enum {
+ THREADINFO_TYPE_UNKNOWN
+} ThreadInfoType;
+
typedef struct {
u64 clock_tick;
} SchedulerInOutEvent;
s32 svcCreateThread(Handle* thread, ThreadFunc entrypoint, u32 arg, u32* stack_top, s32 thread_priority, s32 processor_id);
void __attribute__((noreturn)) svcExitThread();
void svcSleepThread(s64 ns);
+s32 svcGetThreadPriority(s32 *out, Handle handle);
s32 svcSetThreadPriority(Handle thread, s32 prio);
+s32 svcGetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);
+s32 svcSetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);
+s32 svcGetThreadIdealProcessor(s32* processorid, Handle thread);
+s32 svcSetThreadIdealProcessor(Handle thread, s32 processorid);
s32 svcGetProcessorID();
s32 svcCreateMutex(Handle* mutex, bool initially_locked);
s32 svcReleaseMutex(Handle handle);
u64 svcGetSystemTick();
s32 svcGetSystemInfo(s64* out, u32 type, s32 param);
s32 svcGetProcessInfo(s64* out, Handle process, u32 type);
+s32 svcGetThreadInfo(s64* out, Handle thread, ThreadInfoType type);
s32 svcConnectToPort(volatile Handle* out, const char* portName);
s32 svcSendSyncRequest(Handle session);
Result svcOpenProcess(Handle* process, u32 processId);
+Result svcOpenThread(Handle* thread,Handle process, u32 threadId);
s32 svcGetProcessId(u32 *out, Handle handle);
+s32 svcGetProcessIdOfThread(u32 *out, Handle handle);
s32 svcGetThreadId(u32 *out, Handle handle);
s32 svcOutputDebugString(const char* str, int length);
Result svcCreatePort(Handle* portServer, Handle* portClient, const char* name, s32 maxSessions);
svc 0x0A
bx lr
+.global svcGetThreadPriority
+.type svcGetThreadPriority, %function
+svcGetThreadPriority:
+ str r0, [sp, #-0x4]!
+ svc 0x0B
+ ldr r3, [sp], #4
+ str r1, [r3]
+ bx lr
+
.global svcSetThreadPriority
.type svcSetThreadPriority, %function
svcSetThreadPriority:
svc 0x0C
bx lr
+
+.global svcGetThreadAffinityMask
+.type svcGetThreadAffinityMask, %function
+svcGetThreadAffinityMask:
+ svc 0x0D
+ bx lr
+
+.global svcSetThreadAffinityMask
+.type svcSetThreadAffinityMask, %function
+svcSetThreadAffinityMask:
+ svc 0x0E
+ bx lr
+
+.global svcGetThreadIdealProcessor
+.type svcGetThreadIdealProcessor, %function
+svcGetThreadIdealProcessor:
+ str r0, [sp, #-0x4]!
+ svc 0x0F
+ ldr r3, [sp], #4
+ str r1, [r3]
+ bx lr
+
+.global svcSetThreadIdealProcessor
+.type svcSetThreadIdealProcessor, %function
+svcSetThreadIdealProcessor:
+ svc 0x10
+ bx lr
.global svcGetProcessorID
.type svcGetProcessorID, %function
ldr r4, [sp], #4
bx lr
+.global svcGetThreadInfo
+.type svcGetThreadInfo, %function
+svcGetThreadInfo:
+ push {r0,r4}
+ svc 0x2C
+ ldr r4, [sp], #4
+ str r1, [r4]
+ str r2, [r4, #4]
+ ldr r4, [sp], #4
+ bx lr
+
.global svcConnectToPort
.type svcConnectToPort, %function
svcConnectToPort:
str r1, [r2]
bx lr
+
+.global svcOpenThread
+.type svcOpenThread, %function
+svcOpenThread:
+ push {r0}
+ svc 0x34
+ pop {r2}
+ str r1, [r2]
+ bx lr
+
+
.global svcGetProcessId
.type svcGetProcessId, %function
svcGetProcessId:
str r1, [r3]
bx lr
+
+.global svcGetProcessIdOfThread
+.type svcGetProcessIdOfThread, %function
+svcGetProcessIdOfThread:
+ str r0, [sp, #-0x4]!
+ svc 0x36
+ ldr r3, [sp], #4
+ str r1, [r3]
+ bx lr
+
.global svcGetThreadId
.type svcGetThreadId, %function
svcGetThreadId: