Message ID | 20240624193902.22596-1-dilfridge@gentoo.org |
---|---|
State | New |
Headers | show |
Series | [COMMITTED] RISC-V: Execute a PAUSE hint in spin loops | expand |
diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h index c1c9d949a0..90283d9746 100644 --- a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h +++ b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h @@ -178,4 +178,7 @@ # error "ISAs that do not subsume the A extension are not supported" #endif /* !__riscv_atomic */ +/* Execute a PAUSE hint when spinning. */ +#define atomic_spin_nop() __asm(".insn i 0x0f, 0, x0, x0, 0x010") + #endif /* bits/atomic.h */