2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; version 2
8 #include <linux/linkage.h>
9 #include <asm/alternative-asm.h>
10 #include <asm/frame.h>
11 #include <asm/dwarf2.h>
17 * %rsi : memory location to compare
18 * %rax : low 64 bits of old value
19 * %rdx : high 64 bits of old value
20 * %rbx : low 64 bits of new value
21 * %rcx : high 64 bits of new value
22 * %al : Operation successful
24 ENTRY(this_cpu_cmpxchg16b_emu)
28 # Emulate 'cmpxchg16b %gs:(%rsi)' except we return the result in %al not
29 # via the ZF. Caller will access %al to get result.
31 # Note that this is only useful for a cpuops operation. Meaning that we
32 # do *not* have a fully atomic operation but just an operation that is
33 # *atomic* on a single cpu (as provided by the this_cpu_xx class of
36 this_cpu_cmpxchg16b_emu:
42 cmpq %gs:8(%rsi), %rdx
46 movq %rcx, %gs:8(%rsi)
59 ENDPROC(this_cpu_cmpxchg16b_emu)