adjust stack before appInit

This commit is contained in:
Dave Murphy 2015-03-02 10:41:37 +00:00
parent 341f10b057
commit 1f52ac344d
3 changed files with 3 additions and 4 deletions

View File

@ -15,8 +15,6 @@ void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
{
u32 tmp=0;
__appExit();
// Unmap the linear heap
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);

View File

@ -32,6 +32,4 @@ void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
// Build argc/argv if present
__system_initArgv();
__appInit();
}

View File

@ -22,6 +22,8 @@ initSystem:
bics sp, sp, #7
str sp, [r2]
bl __appInit
bl __libc_init_array
ldr r2, =saved_stack
@ -34,6 +36,7 @@ initSystem:
__ctru_exit:
bl __libc_fini_array
bl __appExit
ldr r2, =saved_stack
ldr sp, [r2]