Skip to content

Commit

Permalink
MIPS: compressed: Use correct instruction for 64 bit code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gclement authored and tsbogend committed Dec 21, 2023
1 parent 01940cd commit f99c37d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/mips/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
/* Clear BSS */
PTR_LA a0, _edata
PTR_LA a2, _end
1: sw zero, 0(a0)
addiu a0, a0, 4
1: PTR_S zero, 0(a0)
PTR_ADDIU a0, a0, PTRSIZE
bne a2, a0, 1b

PTR_LA a0, (.heap) /* heap address */
Expand Down

0 comments on commit f99c37d

Please sign in to comment.