1
2 #include <linux/linkage.h>
3 #include <asm/percpu.h>
4
5 .text
6
7
8
9
10
11
12
13
14
15
16 ENTRY(this_cpu_cmpxchg16b_emu)
17
18 #
19
20
21 #
22
23
24 # *atomic* on a single cpu (as provided by the this_cpu_xx class of
25
26 #
27 pushfq
28 cli
29
30 cmpq PER_CPU_VAR((%rsi)), %rax
31 jne .Lnot_same
32 cmpq PER_CPU_VAR(8(%rsi)), %rdx
33 jne .Lnot_same
34
35 movq %rbx, PER_CPU_VAR((%rsi))
36 movq %rcx, PER_CPU_VAR(8(%rsi))
37
38 popfq
39 mov $1, %al
40 ret
41
42 .Lnot_same:
43 popfq
44 xor %al,%al
45 ret
46
47 ENDPROC(this_cpu_cmpxchg16b_emu)