aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/cmpxchg16b_emu.S32
1 files changed, 13 insertions, 19 deletions
diff --git a/arch/x86/lib/cmpxchg16b_emu.S b/arch/x86/lib/cmpxchg16b_emu.S
index 1e572c507d06..40a172541ee2 100644
--- a/arch/x86/lib/cmpxchg16b_emu.S
+++ b/arch/x86/lib/cmpxchg16b_emu.S
@@ -6,15 +6,8 @@
6 * 6 *
7 */ 7 */
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/alternative-asm.h>
10#include <asm/frame.h>
11#include <asm/dwarf2.h> 9#include <asm/dwarf2.h>
12 10#include <asm/percpu.h>
13#ifdef CONFIG_SMP
14#define SEG_PREFIX %gs:
15#else
16#define SEG_PREFIX
17#endif
18 11
19.text 12.text
20 13
@@ -39,24 +32,25 @@ CFI_STARTPROC
39# *atomic* on a single cpu (as provided by the this_cpu_xx class of 32# *atomic* on a single cpu (as provided by the this_cpu_xx class of
40# macros). 33# macros).
41# 34#
42this_cpu_cmpxchg16b_emu: 35 pushfq_cfi
43 pushf
44 cli 36 cli
45 37
46 cmpq SEG_PREFIX(%rsi), %rax 38 cmpq PER_CPU_VAR((%rsi)), %rax
47 jne not_same 39 jne .Lnot_same
48 cmpq SEG_PREFIX 8(%rsi), %rdx 40 cmpq PER_CPU_VAR(8(%rsi)), %rdx
49 jne not_same 41 jne .Lnot_same
50 42
51 movq %rbx, SEG_PREFIX(%rsi) 43 movq %rbx, PER_CPU_VAR((%rsi))
52 movq %rcx, SEG_PREFIX 8(%rsi) 44 movq %rcx, PER_CPU_VAR(8(%rsi))
53 45
54 popf 46 CFI_REMEMBER_STATE
47 popfq_cfi
55 mov $1, %al 48 mov $1, %al
56 ret 49 ret
57 50
58 not_same: 51 CFI_RESTORE_STATE
59 popf 52.Lnot_same:
53 popfq_cfi
60 xor %al,%al 54 xor %al,%al
61 ret 55 ret
62 56