summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spm/cactus/aarch64/cactus_entrypoint.S14
1 files changed, 14 insertions, 0 deletions
diff --git a/spm/cactus/aarch64/cactus_entrypoint.S b/spm/cactus/aarch64/cactus_entrypoint.S
index 1541063..5d9f9f0 100644
--- a/spm/cactus/aarch64/cactus_entrypoint.S
+++ b/spm/cactus/aarch64/cactus_entrypoint.S
@@ -22,6 +22,12 @@ func cactus_entrypoint
/* Entry reason is primary EC cold boot */
mov x19, #1
secondary_cold_entry:
+ /* Saving parameter registers to temporary registers. */
+ mov x10, x1
+ mov x11, x2
+ mov x12, x3
+ mov x13, x4
+
/* Entry reason is secondary EC cold boot */
mrs x0, mpidr_el1
bl platform_get_core_pos
@@ -77,5 +83,13 @@ pie_fixup:
/* Jump to the C entrypoint (it does not return) */
0: mov x0, x19
+
+ /* Restoring parameter registers before jumping to cactus_main. */
+ mov x1, x10
+ mov x2, x11
+ mov x3, x12
+ mov x4, x13
+
+ /* And jump to the C entrypoint. */
b cactus_main
endfunc cactus_entrypoint