5 * lock.h - Hardware level spinlocks
11 struct sShortSpinlock {
16 static inline int IS_LOCKED(struct sShortSpinlock *Lock)
21 static inline int CPU_HAS_LOCK(struct sShortSpinlock *Lock)
23 // TODO: Handle multiple CPUs
27 static inline int SHORTLOCK(struct sShortSpinlock *Lock)
29 // Shamelessly copied from linux (/arch/arm/include/asm/spinlock.h) until I can fix stuff
31 __asm__ __volatile__ (
34 " strexeq %0, %2, [%1]\n" // Magic? TODO: Look up
38 : "r" (&Lock->Lock), "r" (1)
39 : "cc" // Condition codes clobbered
44 static inline void SHORTREL(struct sShortSpinlock *Lock)