aboutsummaryrefslogtreecommitdiffstats
path: root/ports/ARM7/crt0.s
diff options
context:
space:
mode:
Diffstat (limited to 'ports/ARM7/crt0.s')
-rw-r--r--ports/ARM7/crt0.s63
1 files changed, 23 insertions, 40 deletions
diff --git a/ports/ARM7/crt0.s b/ports/ARM7/crt0.s
index d066ee478..91d07935b 100644
--- a/ports/ARM7/crt0.s
+++ b/ports/ARM7/crt0.s
@@ -119,56 +119,33 @@ bssloop:
/*
* Late initialization.
*/
-#ifndef THUMB_NO_INTERWORKING
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
+ bx r0
+.code 16
bl hwinit1
- /*
- * main(0, NULL).
- */
mov r0, #0
mov r1, r0
bl main
- bl port_halt
+ ldr r1, =MainExitHandler
+ bx r1
+.code 32
#else
- add r0, pc, #1
- bx r0
-.code 16
bl hwinit1
mov r0, #0
mov r1, r0
bl main
- bl port_halt
-.code 32
+ b MainExitHandler
#endif
/*
- * Default exceptions handlers. The handlers are declared weak in order to be
- * replaced by the real handling code.
+ * Default main function exit handler.
*/
-.weak UndHandler
-.globl UndHandler
-UndHandler:
-
-.weak SwiHandler
-.globl SwiHandler
-SwiHandler:
-
-.weak PrefetchHandler
-.globl PrefetchHandler
-PrefetchHandler:
-
-.weak AbortHandler
-.globl AbortHandler
-AbortHandler:
-
-.weak FiqHandler
-.globl FiqHandler
-FiqHandler:
+.weak MainExitHandler
+.globl MainExitHandler
+MainExitHandler:
-.loop: b .loop
-
-#ifdef THUMB_NO_INTERWORKING
-.code 16
-#endif
+.loop: b .loop
/*
* Default early initialization code. It is declared weak in order to be
@@ -176,11 +153,14 @@ FiqHandler:
* Early initialization is performed just after reset before BSS and DATA
* segments initialization.
*/
-.global hwinit0
-.weak hwinit0
+#ifdef THUMB_NO_INTERWORKING
.thumb_func
+.code 16
+#endif
+.weak hwinit0
hwinit0:
bx lr
+.code 32
/*
* Default late initialization code. It is declared weak in order to be
@@ -188,11 +168,14 @@ hwinit0:
* Late initialization is performed after BSS and DATA segments initialization
* and before invoking the main() function.
*/
-.global hwinit1
-.weak hwinit1
+#ifdef THUMB_NO_INTERWORKING
.thumb_func
+.code 16
+#endif
+.weak hwinit1
hwinit1:
bx lr
+.code 32
/** @endcond */
/** @} */