Initialize light primitive system if needed
This commit is contained in:
parent
72ea825b2d
commit
abd104fae7
@ -11,6 +11,8 @@ void __appExit();
|
||||
|
||||
void __libc_fini_array(void);
|
||||
|
||||
Result __sync_fini(void) __attribute__((weak));
|
||||
|
||||
void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
||||
{
|
||||
u32 tmp=0;
|
||||
@ -24,6 +26,9 @@ void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
||||
// Close some handles
|
||||
__destroy_handle_list();
|
||||
|
||||
if (__sync_fini)
|
||||
__sync_fini();
|
||||
|
||||
// Jump to the loader if it provided a callback
|
||||
if (__system_retAddr)
|
||||
__system_retAddr();
|
||||
|
@ -18,6 +18,8 @@ void __appInit();
|
||||
void __ctru_exit(int rc);
|
||||
int __libctru_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz);
|
||||
|
||||
Result __sync_init(void) __attribute__((weak));
|
||||
|
||||
void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||
{
|
||||
|
||||
@ -27,6 +29,9 @@ void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||
|
||||
__system_retAddr = __service_ptr ? retAddr : NULL;
|
||||
|
||||
if (__sync_init)
|
||||
__sync_init();
|
||||
|
||||
__system_allocateHeaps();
|
||||
|
||||
// Build argc/argv if present
|
||||
|
Loading…
Reference in New Issue
Block a user