aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/cmpxchg_32.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index f5bd1fd388ff..284a6e8f7ce1 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -246,8 +246,6 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
246 * to simulate the cmpxchg8b on the 80386 and 80486 CPU. 246 * to simulate the cmpxchg8b on the 80386 and 80486 CPU.
247 */ 247 */
248 248
249extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
250
251#define cmpxchg64(ptr, o, n) \ 249#define cmpxchg64(ptr, o, n) \
252({ \ 250({ \
253 __typeof__(*(ptr)) __ret; \ 251 __typeof__(*(ptr)) __ret; \
@@ -265,20 +263,20 @@ extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
265 __ret; }) 263 __ret; })
266 264
267 265
268 266#define cmpxchg64_local(ptr, o, n) \
269#define cmpxchg64_local(ptr, o, n) \ 267({ \
270({ \ 268 __typeof__(*(ptr)) __ret; \
271 __typeof__(*(ptr)) __ret; \ 269 __typeof__(*(ptr)) __old = (o); \
272 if (likely(boot_cpu_data.x86 > 4)) \ 270 __typeof__(*(ptr)) __new = (n); \
273 __ret = (__typeof__(*(ptr)))__cmpxchg64_local((ptr), \ 271 alternative_io("call cmpxchg8b_emu", \
274 (unsigned long long)(o), \ 272 "cmpxchg8b (%%esi)" , \
275 (unsigned long long)(n)); \ 273 X86_FEATURE_CX8, \
276 else \ 274 "=A" (__ret), \
277 __ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr), \ 275 "S" ((ptr)), "0" (__old), \
278 (unsigned long long)(o), \ 276 "b" ((unsigned int)__new), \
279 (unsigned long long)(n)); \ 277 "c" ((unsigned int)(__new>>32)) \
280 __ret; \ 278 : "memory"); \
281}) 279 __ret; })
282 280
283#endif 281#endif
284 282