浏览代码

[PATCH] i386: add alternative-asm.h to allow LOCK_PREFIX replacement in .S files

LOCK_PREFIX is replaced by nops on UP systems, so it has to be a special
macro.  Previously this was only possible from C. Allow it for pure
assembly files too. Similar to earlier x86-64 patch.
Signed-off-by: Andi Kleen <ak@suse.de>
Andi Kleen 18 年之前
父节点
当前提交
07c9819b31
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      include/asm-i386/alternative-asm.i

+ 14 - 0
include/asm-i386/alternative-asm.i

@@ -0,0 +1,14 @@
+#include <linux/config.h>
+
+#ifdef CONFIG_SMP
+	.macro LOCK_PREFIX
+1:	lock
+	.section .smp_locks,"a"
+	.align 4
+	.long 1b
+	.previous
+	.endm
+#else
+	.macro LOCK_PREFIX
+	.endm
+#endif