riscv: Add a Zalrsc-only alternative for synchronization in start.S
authorYao Zi <ziyao@disroot.org>
Tue, 2 Sep 2025 08:19:32 +0000 (08:19 +0000)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Fri, 19 Sep 2025 11:22:29 +0000 (19:22 +0800)
commita681cfecb4346107212f377e2075f6eb1bdc6a2b
tree8b0ab52b167fbe04b90fe22d0e37c1969f2c0fec
parent06b22f38af96ba9d347f2f70bc5ab8d41dd79312
riscv: Add a Zalrsc-only alternative for synchronization in start.S

Add an alternative implementation that use Zalrsc extension only for
HART lottery and SMP locking to support SMP on cores without "Zaamo"
extension available. The Zaamo implementation is still prioritized if
both of them are available, since it takes fewer instructions.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
arch/riscv/cpu/start.S