]> Chaos Git - corbenik/ctrulib.git/commitdiff
revert stack changes, broken on hardware :(
authorDave Murphy <davem@devkitpro.org>
Tue, 30 Dec 2014 04:05:12 +0000 (04:05 +0000)
committerDave Murphy <davem@devkitpro.org>
Tue, 30 Dec 2014 04:05:12 +0000 (04:05 +0000)
libctru/source/system/allocateHeaps.c
libctru/source/system/ctru_exit.c
libctru/source/system/initSystem.c
libctru/source/system/init_exit_Wrappers.s [deleted file]

index d53625c3e42e1bd041f9b3f51e2c218e997b22d5..4009f8ec6d9bef80b33f628d9c63db42da028992 100644 (file)
@@ -7,7 +7,6 @@ u32 __linear_heap;
 u32 __heapBase;
 extern u32 __heap_size, __linear_heap_size;
 
-u32 __attribute__((weak)) __stacksize__ = 32 * 1024;
 
 void __attribute__((weak)) __system_allocateHeaps() {
        u32 tmp=0;
@@ -19,7 +18,7 @@ void __attribute__((weak)) __system_allocateHeaps() {
        // Allocate the linear heap
        svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, 0x3);
        // Set up newlib heap
-       fake_heap_start = (char*)__heapBase + __stacksize__;
-       fake_heap_end = fake_heap_start + __heap_size - __stacksize__;
+       fake_heap_start = (char*)__heapBase;
+       fake_heap_end = fake_heap_start + __heap_size;
 
-}
+}
\ No newline at end of file
index f4c99f1dc78fbe38d7bcee6cdb3f71e5be9f3766..058ea7caa263e31ce1ebaccb4eb355cdfd5b692d 100644 (file)
@@ -11,7 +11,7 @@ void __appExit();
 
 void __libc_fini_array(void);
 
-void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
+void __attribute__((weak)) __attribute__((noreturn)) __ctru_exit(int rc)
 {
        u32 tmp=0;
 
index 47b1067976e17cb7794400263cfd6f1acc7a8955..080d1258c7fdf7a81f08d5ef6b342f9adacde5f2 100644 (file)
@@ -18,7 +18,7 @@ void __libc_init_array(void);
 
 void __ctru_exit(int rc);
 
-void __attribute__((weak)) __ctru_initSystem(void (*retAddr)(void))
+void __attribute__((weak)) initSystem(void (*retAddr)(void))
 {
 
        // Register newlib exit() syscall
diff --git a/libctru/source/system/init_exit_Wrappers.s b/libctru/source/system/init_exit_Wrappers.s
deleted file mode 100644 (file)
index 608f25f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-       .text
-       .arm
-       .cpu mpcore
-
-       .global initSystem
-       .type   initSystem STT_FUNC
-@---------------------------------------------------------------------------------
-initSystem:
-@---------------------------------------------------------------------------------
-       ldr     r0, =saved_lr
-       str     lr, [r0]
-       str     sp, [r0,#4]
-       bl      __ctru_initSystem
-       ldr     r0,=fake_heap_start
-       ldr     sp, [r0]
-       ldr     r0, =saved_lr
-       ldr     pc, [r0]
-
-       .global __ctru_exit
-       .type   __ctru_exit STT_FUNC
-@---------------------------------------------------------------------------------
-__ctru_exit:
-@---------------------------------------------------------------------------------
-       ldr     r1, =saved_stack
-       ldr     sp, [r1]
-       b       __libctru_exit
-
-       .pool
-
-       .bss
-       .align 2
-saved_lr:
-       .space  4
-saved_stack:
-       .space  4