__ctru_exit(): perform svcExitProcess() if there's no retAddr
This commit is contained in:
parent
85a96370e0
commit
0a1d0403d1
@ -27,9 +27,9 @@ typedef enum {
|
|||||||
u32* getThreadCommandBuffer(void);
|
u32* getThreadCommandBuffer(void);
|
||||||
|
|
||||||
s32 svcControlMemory(u32* addr_out, u32 addr0, u32 addr1, u32 size, MemOp op, MemPerm perm);
|
s32 svcControlMemory(u32* addr_out, u32 addr0, u32 addr1, u32 size, MemOp op, MemPerm perm);
|
||||||
void svcExitProcess();
|
void __attribute__((noreturn)) svcExitProcess();
|
||||||
s32 svcCreateThread(Handle* thread, ThreadFunc entrypoint, u32 arg, u32* stack_top, s32 thread_priority, s32 processor_id);
|
s32 svcCreateThread(Handle* thread, ThreadFunc entrypoint, u32 arg, u32* stack_top, s32 thread_priority, s32 processor_id);
|
||||||
void svcExitThread();
|
void __attribute__((noreturn)) svcExitThread();
|
||||||
void svcSleepThread(s64 ns);
|
void svcSleepThread(s64 ns);
|
||||||
s32 svcCreateMutex(Handle* mutex, bool initially_locked);
|
s32 svcCreateMutex(Handle* mutex, bool initially_locked);
|
||||||
s32 svcReleaseMutex(Handle handle);
|
s32 svcReleaseMutex(Handle handle);
|
||||||
|
@ -20,7 +20,7 @@ extern char* fake_heap_end;
|
|||||||
|
|
||||||
static void initArgv();
|
static void initArgv();
|
||||||
|
|
||||||
void __ctru_exit(int rc)
|
void __attribute__((noreturn)) __ctru_exit(int rc)
|
||||||
{
|
{
|
||||||
// Run the global destructors
|
// Run the global destructors
|
||||||
__libc_fini_array();
|
__libc_fini_array();
|
||||||
@ -35,8 +35,8 @@ void __ctru_exit(int rc)
|
|||||||
if (__system_retAddr)
|
if (__system_retAddr)
|
||||||
__system_retAddr();
|
__system_retAddr();
|
||||||
|
|
||||||
// Since above did not jump: hang
|
// Since above did not jump, end this process
|
||||||
for (;;);
|
svcExitProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initSystem(void (*retAddr)(void))
|
void initSystem(void (*retAddr)(void))
|
||||||
|
Loading…
Reference in New Issue
Block a user