Notes in ispinlock
This commit is contained in:
parent
97e2508516
commit
ddddf903dc
1 changed files with 1 additions and 0 deletions
|
@ -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");
|
||||||
|
|
Loading…
Add table
Reference in a new issue