Skip to content

Commit f99c37d

Browse files
gclementtsbogend
authored andcommitted
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: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 01940cd commit f99c37d

File tree

1 file changed

+2
-2
lines changed
  • arch/mips/boot/compressed

1 file changed

+2
-2
lines changed

arch/mips/boot/compressed/head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
/* Clear BSS */
2626
PTR_LA a0, _edata
2727
PTR_LA a2, _end
28-
1: sw zero, 0(a0)
29-
addiu a0, a0, 4
28+
1: PTR_S zero, 0(a0)
29+
PTR_ADDIU a0, a0, PTRSIZE
3030
bne a2, a0, 1b
3131

3232
PTR_LA a0, (.heap) /* heap address */

0 commit comments

Comments
 (0)