diff options
Diffstat (limited to 'arch/x86/include/asm/atomic.h')
| -rw-r--r-- | arch/x86/include/asm/atomic.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 10572e309ab2..58cb6d4085f7 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
| @@ -172,18 +172,14 @@ static inline int atomic_add_negative(int i, atomic_t *v) | |||
| 172 | */ | 172 | */ |
| 173 | static inline int atomic_add_return(int i, atomic_t *v) | 173 | static inline int atomic_add_return(int i, atomic_t *v) |
| 174 | { | 174 | { |
| 175 | int __i; | ||
| 176 | #ifdef CONFIG_M386 | 175 | #ifdef CONFIG_M386 |
| 176 | int __i; | ||
| 177 | unsigned long flags; | 177 | unsigned long flags; |
| 178 | if (unlikely(boot_cpu_data.x86 <= 3)) | 178 | if (unlikely(boot_cpu_data.x86 <= 3)) |
| 179 | goto no_xadd; | 179 | goto no_xadd; |
| 180 | #endif | 180 | #endif |
| 181 | /* Modern 486+ processor */ | 181 | /* Modern 486+ processor */ |
| 182 | __i = i; | 182 | return i + xadd(&v->counter, i); |
| 183 | asm volatile(LOCK_PREFIX "xaddl %0, %1" | ||
| 184 | : "+r" (i), "+m" (v->counter) | ||
| 185 | : : "memory"); | ||
| 186 | return i + __i; | ||
| 187 | 183 | ||
| 188 | #ifdef CONFIG_M386 | 184 | #ifdef CONFIG_M386 |
| 189 | no_xadd: /* Legacy 386 processor */ | 185 | no_xadd: /* Legacy 386 processor */ |
