aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-i386/spinlock.h')
-rw-r--r--include/asm-i386/spinlock.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index c18b71fae6b3..d3bcebed60ca 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -7,8 +7,14 @@
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9 9
10#ifdef CONFIG_PARAVIRT
11#include <asm/paravirt.h>
12#else
10#define CLI_STRING "cli" 13#define CLI_STRING "cli"
11#define STI_STRING "sti" 14#define STI_STRING "sti"
15#define CLI_STI_CLOBBERS
16#define CLI_STI_INPUT_ARGS
17#endif /* CONFIG_PARAVIRT */
12 18
13/* 19/*
14 * Your basic SMP spinlocks, allowing only a single CPU anywhere 20 * Your basic SMP spinlocks, allowing only a single CPU anywhere
@@ -53,25 +59,28 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long fla
53{ 59{
54 asm volatile( 60 asm volatile(
55 "\n1:\t" 61 "\n1:\t"
56 LOCK_PREFIX " ; decb %0\n\t" 62 LOCK_PREFIX " ; decb %[slock]\n\t"
57 "jns 5f\n" 63 "jns 5f\n"
58 "2:\t" 64 "2:\t"
59 "testl $0x200, %1\n\t" 65 "testl $0x200, %[flags]\n\t"
60 "jz 4f\n\t" 66 "jz 4f\n\t"
61 STI_STRING "\n" 67 STI_STRING "\n"
62 "3:\t" 68 "3:\t"
63 "rep;nop\n\t" 69 "rep;nop\n\t"
64 "cmpb $0, %0\n\t" 70 "cmpb $0, %[slock]\n\t"
65 "jle 3b\n\t" 71 "jle 3b\n\t"
66 CLI_STRING "\n\t" 72 CLI_STRING "\n\t"
67 "jmp 1b\n" 73 "jmp 1b\n"
68 "4:\t" 74 "4:\t"
69 "rep;nop\n\t" 75 "rep;nop\n\t"
70 "cmpb $0, %0\n\t" 76 "cmpb $0, %[slock]\n\t"
71 "jg 1b\n\t" 77 "jg 1b\n\t"
72 "jmp 4b\n" 78 "jmp 4b\n"
73 "5:\n\t" 79 "5:\n\t"
74 : "+m" (lock->slock) : "r" (flags) : "memory"); 80 : [slock] "+m" (lock->slock)
81 : [flags] "r" (flags)
82 CLI_STI_INPUT_ARGS
83 : "memory" CLI_STI_CLOBBERS);
75} 84}
76#endif 85#endif
77 86