Notes in ispinlock

This commit is contained in:
Imbus 2025-08-16 16:12:01 +02:00
parent 97e2508516
commit ddddf903dc

View file

@ -18,6 +18,7 @@ void spin_unlock(spinlock_t *l) {
} }
// Optional: tiny pause/backoff (works even if Zihintpause isn't present). // Optional: tiny pause/backoff (works even if Zihintpause isn't present).
// See: https://github.com/riscv/riscv-isa-manual/blob/main/src/zihintpause.adoc
void cpu_relax(void) { void cpu_relax(void) {
#if defined(__riscv_zihintpause) #if defined(__riscv_zihintpause)
__asm__ volatile("pause"); __asm__ volatile("pause");