Commit f940260a authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: unify duplicated bss init code

Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent ede6f5ae
...@@ -195,6 +195,19 @@ ENDPROC(__start) ...@@ -195,6 +195,19 @@ ENDPROC(__start)
# define WDOG_CTL WDOGA_CTL # define WDOG_CTL WDOGA_CTL
#endif #endif
ENTRY(__init_clear_bss)
r2 = r2 - r1;
cc = r2 == 0;
if cc jump .L_bss_done;
r2 >>= 2;
p1 = r1;
p2 = r2;
lsetup (1f, 1f) lc0 = p2;
1: [p1++] = r0;
.L_bss_done:
rts;
ENDPROC(__init_clear_bss)
ENTRY(_real_start) ENTRY(_real_start)
/* Enable nested interrupts */ /* Enable nested interrupts */
[--sp] = reti; [--sp] = reti;
...@@ -206,75 +219,34 @@ ENTRY(_real_start) ...@@ -206,75 +219,34 @@ ENTRY(_real_start)
w[p0] = r0; w[p0] = r0;
ssync; ssync;
r0 = 0 (x);
/* Zero out all of the fun bss regions */
#if L1_DATA_A_LENGTH > 0 #if L1_DATA_A_LENGTH > 0
r1.l = __sbss_l1; r1.l = __sbss_l1;
r1.h = __sbss_l1; r1.h = __sbss_l1;
r2.l = __ebss_l1; r2.l = __ebss_l1;
r2.h = __ebss_l1; r2.h = __ebss_l1;
r0 = 0 (z); call __init_clear_bss
r2 = r2 - r1;
cc = r2 == 0;
if cc jump .L_a_l1_done;
r2 >>= 2;
p1 = r1;
p2 = r2;
lsetup (.L_clear_a_l1, .L_clear_a_l1 ) lc0 = p2;
.L_clear_a_l1:
[p1++] = r0;
.L_a_l1_done:
#endif #endif
#if L1_DATA_B_LENGTH > 0 #if L1_DATA_B_LENGTH > 0
r1.l = __sbss_b_l1; r1.l = __sbss_b_l1;
r1.h = __sbss_b_l1; r1.h = __sbss_b_l1;
r2.l = __ebss_b_l1; r2.l = __ebss_b_l1;
r2.h = __ebss_b_l1; r2.h = __ebss_b_l1;
r0 = 0 (z); call __init_clear_bss
r2 = r2 - r1;
cc = r2 == 0;
if cc jump .L_b_l1_done;
r2 >>= 2;
p1 = r1;
p2 = r2;
lsetup (.L_clear_b_l1, .L_clear_b_l1 ) lc0 = p2;
.L_clear_b_l1:
[p1++] = r0;
.L_b_l1_done:
#endif #endif
#if L2_LENGTH > 0 #if L2_LENGTH > 0
r1.l = __sbss_l2; r1.l = __sbss_l2;
r1.h = __sbss_l2; r1.h = __sbss_l2;
r2.l = __ebss_l2; r2.l = __ebss_l2;
r2.h = __ebss_l2; r2.h = __ebss_l2;
r0 = 0 (z); call __init_clear_bss
r2 = r2 - r1;
cc = r2 == 0;
if cc jump .L_l2_done;
r2 >>= 2;
p1 = r1;
p2 = r2;
lsetup (.L_clear_l2, .L_clear_l2 ) lc0 = p2;
.L_clear_l2:
[p1++] = r0;
.L_l2_done:
#endif #endif
/* Zero out the bss region
* Note: this will fail if bss is 0 bytes ...
*/
r0 = 0 (z);
r1.l = ___bss_start; r1.l = ___bss_start;
r1.h = ___bss_start; r1.h = ___bss_start;
r2.l = ___bss_stop; r2.l = ___bss_stop;
r2.h = ___bss_stop; r2.h = ___bss_stop;
r2 = r2 - r1; call __init_clear_bss
r2 >>= 2;
p1 = r1;
p2 = r2;
lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
.L_clear_bss:
[p1++] = r0;
/* In case there is a NULL pointer reference, /* In case there is a NULL pointer reference,
* zero out region before stext * zero out region before stext
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment