]> git.baikalelectronics.ru Git - uboot.git/commit
riscv: save hart ID in register tp instead of s0
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>
Sun, 17 Mar 2019 18:28:36 +0000 (19:28 +0100)
committerAndes <uboot@andestech.com>
Mon, 8 Apr 2019 01:44:26 +0000 (09:44 +0800)
commit2e24f3fb0864ff48cd0a11160da762e51718cd9e
tree58ef47a874006860056e4393224ac111ef25571d
parent4c83d431f82083eb8c921623a93030e077cff1d8
riscv: save hart ID in register tp instead of s0

The hart ID passed by the previous boot stage is currently stored in
register s0. If we divert the control flow inside a function, which is
required as part of multi-hart support, the function epilog may not be
called, clobbering register s0. Save the hart ID in the unallocatable
register tp instead to protect the hart ID.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
arch/riscv/cpu/start.S