Commit f99c37d5 authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Thomas Bogendoerfer

MIPS: compressed: Use correct instruction for 64 bit code

The code clearing BSS already use macro or use correct instruction
depending if the CPU is 32 bits or 64 bits. However, a few
instructions remained 32 bits only.

By using the accurate MACRO, it is now possible to deal with memory
address beyond 32 bits. As a side effect, when using 64bits processor,
it also divides the loop number needed to clear the BSS by 2.
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 01940cd4
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
/* Clear BSS */ /* Clear BSS */
PTR_LA a0, _edata PTR_LA a0, _edata
PTR_LA a2, _end PTR_LA a2, _end
1: sw zero, 0(a0) 1: PTR_S zero, 0(a0)
addiu a0, a0, 4 PTR_ADDIU a0, a0, PTRSIZE
bne a2, a0, 1b bne a2, a0, 1b
PTR_LA a0, (.heap) /* heap address */ PTR_LA a0, (.heap) /* heap address */
......
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