mirror of
https://github.com/torvalds/linux.git
synced 2026-09-15 15:01:08 -04:00
[PATCH] i386: Abstract sensitive instructions
Abstract sensitive instructions in assembler code, replacing them with macros (which currently are #defined to the native versions). We use long names: assembler is case-insensitive, so if something goes wrong and macros do not expand, it would assemble anyway. Resulting object files are exactly the same as before. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Andi Kleen <ak@suse.de>
This commit is contained in:
committed by
Andi Kleen
parent
7b0bda74f7
commit
0da5db3133
@@ -7,6 +7,9 @@
|
||||
#include <asm/processor.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define CLI_STRING "cli"
|
||||
#define STI_STRING "sti"
|
||||
|
||||
/*
|
||||
* Your basic SMP spinlocks, allowing only a single CPU anywhere
|
||||
*
|
||||
@@ -55,12 +58,12 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long fla
|
||||
"2:\t"
|
||||
"testl $0x200, %1\n\t"
|
||||
"jz 4f\n\t"
|
||||
"sti\n"
|
||||
STI_STRING "\n"
|
||||
"3:\t"
|
||||
"rep;nop\n\t"
|
||||
"cmpb $0, %0\n\t"
|
||||
"jle 3b\n\t"
|
||||
"cli\n\t"
|
||||
CLI_STRING "\n\t"
|
||||
"jmp 1b\n"
|
||||
"4:\t"
|
||||
"rep;nop\n\t"
|
||||
|
||||
Reference in New Issue
Block a user