Created
June 29, 2012 15:32
-
-
Save heechul/3018642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline void arch_spin_lock(arch_spinlock_t *lock) | |
{ | |
unsigned long tmp; | |
__asm__ __volatile__( | |
1: "1: ldrex %0, [%1]\n" | |
2: " teq %0, #0\n" | |
3: WFE("ne") | |
4: " strexeq %0, %2, [%1]\n" | |
5: " teqeq %0, #0\n" | |
6: " bne 1b" | |
: "=&r" (tmp) | |
: "r" (&lock->lock), "r" (1) | |
: "cc"); | |
7: smp_mb(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment