diff options
Diffstat (limited to 'firmware/target/sh/crt0.S')
-rw-r--r-- | firmware/target/sh/crt0.S | 23 |
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: | |||
98 | mov #0,r0 | 98 | mov #0,r0 |
99 | ldc r0,gbr | 99 | ldc r0,gbr |
100 | 100 | ||
101 | /* zero out .ibss */ | 101 | /* .iram copy is done first since it is reclaimed for other |
102 | mov.l .iedata_k,r0 | 102 | * uninitialized sections */ |
103 | mov.l .iend_k,r1 | ||
104 | bra .iedatastart | ||
105 | mov #0,r2 | ||
106 | .iedataloop: /* backwards is faster and shorter */ | ||
107 | mov.l r2,@-r1 | ||
108 | .iedatastart: | ||
109 | cmp/hi r0,r1 | ||
110 | bt .iedataloop | ||
111 | 103 | ||
112 | /* copy the .iram section */ | 104 | /* copy the .iram section */ |
113 | mov.l .iramcopy_k,r0 | 105 | mov.l .iramcopy_k,r0 |
@@ -127,6 +119,17 @@ start: | |||
127 | bt .iramloop | 119 | bt .iramloop |
128 | .noiramcopy: | 120 | .noiramcopy: |
129 | 121 | ||
122 | /* zero out .ibss */ | ||
123 | mov.l .iedata_k,r0 | ||
124 | mov.l .iend_k,r1 | ||
125 | bra .iedatastart | ||
126 | mov #0,r2 | ||
127 | .iedataloop: /* backwards is faster and shorter */ | ||
128 | mov.l r2,@-r1 | ||
129 | .iedatastart: | ||
130 | cmp/hi r0,r1 | ||
131 | bt .iedataloop | ||
132 | |||
130 | /* zero out bss */ | 133 | /* zero out bss */ |
131 | mov.l .edata_k,r0 | 134 | mov.l .edata_k,r0 |
132 | mov.l .end_k,r1 | 135 | mov.l .end_k,r1 |