Go to the documentation of this file.
24 #ifndef __ARCH_SPINLOCK_H
25 #define __ARCH_SPINLOCK_H
29 #include <sys/cdefs.h>
43 #define SPINLOCK_INITIALIZER 0
52 #define spinlock_init(A) *(A) = SPINLOCK_INITIALIZER
64 #define spinlock_lock(A) do { \
65 spinlock_t * __lock = A; \
68 asm volatile ("tas.b @%1\n\t" \
70 : "=r" (__gotlock) : "r" (__lock) : "t", "memory"); \
84 #define spinlock_unlock(A) do { \
96 #define spinlock_is_locked(A) ( *(A) != 0 )