summaryrefslogtreecommitdiffstats
path: root/firmware/target/sh/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/sh/crt0.S')
-rw-r--r--firmware/target/sh/crt0.S23
1 files changed, 13 insertions, 10 deletions
diff --git a/firmware/target/sh/crt0.S b/firmware/target/sh/crt0.S
index a87bee899f..0e8bbfdd68 100644
--- a/firmware/target/sh/crt0.S
+++ b/firmware/target/sh/crt0.S
@@ -98,16 +98,8 @@ start:
mov #0,r0
ldc r0,gbr
- /* zero out .ibss */
- mov.l .iedata_k,r0
- mov.l .iend_k,r1
- bra .iedatastart
- mov #0,r2
-.iedataloop: /* backwards is faster and shorter */
- mov.l r2,@-r1
-.iedatastart:
- cmp/hi r0,r1
- bt .iedataloop
+ /* .iram copy is done first since it is reclaimed for other
+ * uninitialized sections */
/* copy the .iram section */
mov.l .iramcopy_k,r0
@@ -127,6 +119,17 @@ start:
bt .iramloop
.noiramcopy:
+ /* zero out .ibss */
+ mov.l .iedata_k,r0
+ mov.l .iend_k,r1
+ bra .iedatastart
+ mov #0,r2
+.iedataloop: /* backwards is faster and shorter */
+ mov.l r2,@-r1
+.iedatastart:
+ cmp/hi r0,r1
+ bt .iedataloop
+
/* zero out bss */
mov.l .edata_k,r0
mov.l .end_k,r1