summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-28 19:23:22 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-28 20:32:38 +0100
commit744ea2ff431a2b19e3fc2074525ce5953ad56609 (patch)
tree863fa3fd2add87c1bfa3b1a03a9a2449514c5dbf
parent9e258652c47b0225730a19775304a33649f5c0a2 (diff)
downloadrockbox-744ea2ff43.tar.gz
rockbox-744ea2ff43.zip
x1000: Allow SPL and bootloader to pass arguments to next stage
Change-Id: I61591d704c14acf06cd192a6e9355f0a9c25d0d8
-rw-r--r--firmware/target/mips/ingenic_x1000/crt0.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/crt0.S b/firmware/target/mips/ingenic_x1000/crt0.S
index 86129a35a1..ad2719474b 100644
--- a/firmware/target/mips/ingenic_x1000/crt0.S
+++ b/firmware/target/mips/ingenic_x1000/crt0.S
@@ -55,6 +55,12 @@ _header:
#endif
_realstart:
+ /* Save bootloader arguments. */
+ move s0, a0
+ move s1, a1
+ move s2, a2
+ move s3, a3
+
/* Copy IRAM from BSS to low memory. */
la a0, _iramcopy
la a1, _iramstart
@@ -109,6 +115,13 @@ _realstart:
/* Jump to C code */
jal system_early_init
nop
+
+ /* Restore bootloader arguments, jump to main. */
+ move a0, s0
+ move a1, s1
+ move a2, s2
+ move a3, s3
+
j main
move ra, zero /* init backtrace root */