diff options
author | J-Alves <joao.alves@arm.com> | 2022-02-08 14:06:20 +0000 |
---|---|---|
committer | J-Alves <joao.alves@arm.com> | 2022-02-08 17:37:32 +0000 |
commit | 3913795ee5daae5fb2770c1ff153ba2dc5ab9a61 (patch) | |
tree | 459099a888875f39178be30bb7e884c5f9e9100f /spm/cactus/aarch64 | |
parent | a7ccb402229b3b9419ec17f311576ffdf1e037b7 (diff) |
feat(cactus): save and restore GP x0-x4 on entry
The GP registers x0-x4 can be used to pass information from the SPMC
to the SP at cold boot.
They are also used for initialization operations before execution gets
to the main function.
This patch saves their state at the entry to a cold boot, and restores
them before jumping to cactus main.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I0c4efe8b35a50596813645b0e94df3cced73d855
Diffstat (limited to 'spm/cactus/aarch64')
-rw-r--r-- | spm/cactus/aarch64/cactus_entrypoint.S | 14 |
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 |