mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 05:12:39 +02:00
Fix 85d7ac4
This commit is contained in:
parent
85d7ac4da1
commit
e7c57fbd0b
@ -4,7 +4,7 @@
|
|||||||
#include "services/sm.h"
|
#include "services/sm.h"
|
||||||
#include "services/fatal.h"
|
#include "services/fatal.h"
|
||||||
|
|
||||||
void NORETURN __nx_exit(LoaderReturnFn retaddr, Result rc);
|
void NORETURN __nx_exit(Result rc, LoaderReturnFn retaddr);
|
||||||
|
|
||||||
static bool g_isNso = false;
|
static bool g_isNso = false;
|
||||||
static Handle g_mainThreadHandle = INVALID_HANDLE;
|
static Handle g_mainThreadHandle = INVALID_HANDLE;
|
||||||
@ -90,7 +90,7 @@ void envSetup(void* ctx, Handle main_thread, LoaderReturnFn saved_lr)
|
|||||||
if (ent->Flags & EntryFlag_IsMandatory)
|
if (ent->Flags & EntryFlag_IsMandatory)
|
||||||
{
|
{
|
||||||
// Encountered unknown but mandatory key, bail back to loader.
|
// Encountered unknown but mandatory key, bail back to loader.
|
||||||
__nx_exit(g_loaderRetAddr, MAKERESULT(346, 100 + ent->Key));
|
__nx_exit(MAKERESULT(346, 100 + ent->Key), g_loaderRetAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "runtime/devices/fs_dev.h"
|
#include "runtime/devices/fs_dev.h"
|
||||||
|
|
||||||
void* __stack_top;
|
void* __stack_top;
|
||||||
void NORETURN __nx_exit(LoaderReturnFn retaddr, Result rc);
|
void NORETURN __nx_exit(Result rc, LoaderReturnFn retaddr);
|
||||||
|
|
||||||
void virtmemSetup(void);
|
void virtmemSetup(void);
|
||||||
void newlibSetup(void);
|
void newlibSetup(void);
|
||||||
@ -134,5 +134,5 @@ void __attribute__((weak)) NORETURN __libnx_exit(int rc)
|
|||||||
// Clean up services.
|
// Clean up services.
|
||||||
__appExit();
|
__appExit();
|
||||||
|
|
||||||
__nx_exit(envGetExitFuncPtr(), 0);
|
__nx_exit(0, envGetExitFuncPtr());
|
||||||
}
|
}
|
||||||
|
@ -62,13 +62,10 @@ bss_loop:
|
|||||||
.global __nx_exit
|
.global __nx_exit
|
||||||
.type __nx_exit, %function
|
.type __nx_exit, %function
|
||||||
__nx_exit:
|
__nx_exit:
|
||||||
mov x8, x0
|
|
||||||
|
|
||||||
// restore stack pointer
|
// restore stack pointer
|
||||||
adrp x0, __stack_top
|
adrp x8, __stack_top
|
||||||
ldr x0, [x0, #:lo12:__stack_top]
|
ldr x8, [x8, #:lo12:__stack_top]
|
||||||
mov sp, x0
|
mov sp, x8
|
||||||
|
|
||||||
// jump back to loader
|
// jump back to loader
|
||||||
mov x0, #0
|
br x1
|
||||||
br x8
|
|
||||||
|
Loading…
Reference in New Issue
Block a user