aboutsummaryrefslogtreecommitdiffstats
path: root/ports/ARMCM3/crt0.s
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-04 09:31:36 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-04 09:31:36 +0000
commit9415b92dde53fe5898be66a29ccf35bb25d2ebe5 (patch)
treefa02cd4b70eb9a7ba5ae6d742b8b8530403ce582 /ports/ARMCM3/crt0.s
parent102341ad5d0e39af783675233b888977ab4585db (diff)
downloadChibiOS-9415b92dde53fe5898be66a29ccf35bb25d2ebe5.tar.gz
ChibiOS-9415b92dde53fe5898be66a29ccf35bb25d2ebe5.tar.bz2
ChibiOS-9415b92dde53fe5898be66a29ccf35bb25d2ebe5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@450 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARMCM3/crt0.s')
-rw-r--r--ports/ARMCM3/crt0.s32
1 files changed, 30 insertions, 2 deletions
diff --git a/ports/ARMCM3/crt0.s b/ports/ARMCM3/crt0.s
index 0f2f4667d..b59f0993b 100644
--- a/ports/ARMCM3/crt0.s
+++ b/ports/ARMCM3/crt0.s
@@ -48,6 +48,10 @@ ResetHandler:
// ldr r1, =__process_stack_size__
// sub r0, r0, r1
/*
+ * Early initialization.
+ */
+ bl hwinit0
+ /*
* Data initialization.
* NOTE: It assumes that the DATA size is a multiple of 4.
*/
@@ -82,9 +86,9 @@ bloop:
msr BASEPRI, r0
cpsie i
/*
- * Application-provided HW initialization routine.
+ * Late initialization.
*/
- bl hwinit
+ bl hwinit1
/*
* main(0, NULL).
*/
@@ -92,3 +96,27 @@ bloop:
mov r1, r0
bl main
bl chSysHalt
+
+/*
+ * Default early initialization code. It is declared weak in order to be
+ * replaced by the real initialization code.
+ * Early initialization is performed just after reset before BSS and DATA
+ * segments initialization.
+ */
+.thumb_func
+.global hwinit0
+.weak hwinit0
+hwinit0:
+ bx lr
+
+/*
+ * Default late initialization code. It is declared weak in order to be
+ * replaced by the real initialization code.
+ * Late initialization is performed after BSS and DATA segments initialization
+ * and before invoking the main() function.
+ */
+.thumb_func
+.global hwinit1
+.weak hwinit1
+hwinit1:
+ bx lr