diff --git a/kern/ispinlock.c b/kern/ispinlock.c index 4a7b751..01965f8 100644 --- a/kern/ispinlock.c +++ b/kern/ispinlock.c @@ -19,7 +19,7 @@ void spin_unlock(spinlock_t *l) { // 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) { +static inline void cpu_relax(void) { #if defined(__riscv_zihintpause) __asm__ volatile("pause"); #else diff --git a/kern/ispinlock.h b/kern/ispinlock.h index e0303d6..d71af17 100644 --- a/kern/ispinlock.h +++ b/kern/ispinlock.h @@ -8,5 +8,4 @@ typedef struct { void spinlock_init(spinlock_t *l); bool spin_trylock(spinlock_t *l); void spin_unlock(spinlock_t *l); -void cpu_relax(void); void spin_lock(spinlock_t *l);