ARC: optimize kernel bss clearing in early boot code
authorVineet Gupta <vgupta@synopsys.com>
Thu, 17 Apr 2014 11:43:26 +0000 (17:13 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Thu, 26 Jun 2014 04:44:05 +0000 (10:14 +0530)
using ARC ZOL which reduces tot num of instructions by half

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/kernel/head.S
arch/arc/kernel/vmlinux.lds.S

index 07a58f2d3077724a4667052b8b73400093eb1d30..4d2481bd8b98dc9e1017b953afafcdf3379c3c27 100644 (file)
@@ -77,10 +77,11 @@ stext:
        ; Clear BSS before updating any globals
        ; XXX: use ZOL here
        mov     r5, __bss_start
-       mov     r6, __bss_stop
+       sub     r6, __bss_stop, r5
+       lsr.f   lp_count, r6, 2
+       lpnz    1f
+       st.ab   0, [r5, 4]
 1:
-       st.ab   0, [r5,4]
-       brlt    r5, r6, 1b
 
        ; Uboot - kernel ABI
        ;    r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2
index 2555f5886af624dc508354e2938ca32b4373d450..dd35bde39f6938e483b2cfd2a2e39a1cf2148c71 100644 (file)
@@ -116,7 +116,7 @@ SECTIONS
 
        _edata = .;
 
-       BSS_SECTION(0, 0, 0)
+       BSS_SECTION(4, 4, 4)
 
 #ifdef CONFIG_ARC_DW2_UNWIND
        . = ALIGN(PAGE_SIZE);