16 #include <linux/module.h>
17 #include <asm/processor.h>
26 static inline u32 arch_spin_read_noalloc(
void *lock)
38 __insn_fetchand4(&lock->
lock, ~__ARCH_SPIN_NEXT_OVERFLOW);
39 my_ticket &= ~__ARCH_SPIN_NEXT_OVERFLOW;
43 u32 val = arch_spin_read_noalloc(lock);
44 u32 delta = my_ticket - arch_spin_current(val);
57 u32 val = arch_spin_read_noalloc(lock);
58 if (
unlikely(arch_spin_current(val) != arch_spin_next(val)))
69 delay_backoff(iterations++);
82 delay_backoff(iterations++);
83 val = __insn_fetchaddgez4(&rw->
lock, 1);
84 }
while (
unlikely(arch_write_val_locked(val)));
98 if (!arch_write_val_locked(val))
100 delay_backoff(iterations++);