提交 3f635721 编写于 作者: J Jan Beulich 提交者: Thomas Gleixner

x86: Improve cmpxchg16b_emu.S

- don't include unneeded headers
- don't open-code PER_CPU_VAR()
- drop redundant entry point label
- complete unwind annotations
- use .L prefix on local label to not clutter the symbol table
Signed-off-by: NJan Beulich <jbeulich@suse.com>
Link: http://lkml.kernel.org/r/542290BC020000780003807D@mail.emea.novell.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 212be3b2
...@@ -6,15 +6,8 @@ ...@@ -6,15 +6,8 @@
* *
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/alternative-asm.h>
#include <asm/frame.h>
#include <asm/dwarf2.h> #include <asm/dwarf2.h>
#include <asm/percpu.h>
#ifdef CONFIG_SMP
#define SEG_PREFIX %gs:
#else
#define SEG_PREFIX
#endif
.text .text
...@@ -39,24 +32,25 @@ CFI_STARTPROC ...@@ -39,24 +32,25 @@ CFI_STARTPROC
# *atomic* on a single cpu (as provided by the this_cpu_xx class of # *atomic* on a single cpu (as provided by the this_cpu_xx class of
# macros). # macros).
# #
this_cpu_cmpxchg16b_emu: pushfq_cfi
pushf
cli cli
cmpq SEG_PREFIX(%rsi), %rax cmpq PER_CPU_VAR((%rsi)), %rax
jne not_same jne .Lnot_same
cmpq SEG_PREFIX 8(%rsi), %rdx cmpq PER_CPU_VAR(8(%rsi)), %rdx
jne not_same jne .Lnot_same
movq %rbx, SEG_PREFIX(%rsi) movq %rbx, PER_CPU_VAR((%rsi))
movq %rcx, SEG_PREFIX 8(%rsi) movq %rcx, PER_CPU_VAR(8(%rsi))
popf CFI_REMEMBER_STATE
popfq_cfi
mov $1, %al mov $1, %al
ret ret
not_same: CFI_RESTORE_STATE
popf .Lnot_same:
popfq_cfi
xor %al,%al xor %al,%al
ret ret
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册