Skip to content
Unverified Commit 81c7f619 authored by Christoph Müllner's avatar Christoph Müllner Committed by Andreas K. Hüttel
Browse files

RISC-V: Execute a PAUSE hint in spin loops



The atomic_spin_nop() macro can be used to run arch-specific
code in the body of a spin loop to potentially improve efficiency.
RISC-V's Zihintpause extension includes a PAUSE instruction for
this use-case, which is encoded as a HINT, which means that it
behaves like a NOP on systems that don't implement Zihintpause.

Binutils supports Zihintpause since 2.36, so this patch uses
the ".insn" directive to keep the code compatible with older
toolchains.

Signed-off-by: default avatarChristoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
Acked-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 9e06e4a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment