Skip to content

Commit

Permalink
ARC: optimize kernel bss clearing in early boot code
Browse files Browse the repository at this point in the history
using ARC ZOL which reduces tot num of instructions by half

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Jun 26, 2014
1 parent ba25915 commit bef444a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions arch/arc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ SECTIONS

_edata = .;

BSS_SECTION(0, 0, 0)
BSS_SECTION(4, 4, 4)

#ifdef CONFIG_ARC_DW2_UNWIND
. = ALIGN(PAGE_SIZE);
Expand Down

0 comments on commit bef444a

Please sign in to comment.