Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: zboot: Avoid endless loop in clear BSS.

Commit 2ee1503e546f ("MIPS: zboot: head.S clean up").

After .noreorder removed, clear BSS fall into endless loop. The bne
instruction will add nop to the delay slot at compile time. So a0
register will not increment by 4. Fix it and clear BSS from _edata
to (_end - 1).

Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Jinyang He and committed by
Thomas Bogendoerfer
fdd85e04 a6e83ace

+1 -1
+1 -1
arch/mips/boot/compressed/head.S
··· 26 26 PTR_LA a0, _edata 27 27 PTR_LA a2, _end 28 28 1: sw zero, 0(a0) 29 + addiu a0, a0, 4 29 30 bne a2, a0, 1b 30 - addiu a0, a0, 4 31 31 32 32 PTR_LA a0, (.heap) /* heap address */ 33 33 PTR_LA sp, (.stack + 8192) /* stack address */