diff options
author | Andi Kleen <ak@suse.de> | 2007-05-02 13:27:20 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:20 -0400 |
commit | e859dc553c857f4672b3bbb73ee9170a901f8712 (patch) | |
tree | b71603823255c6eadfb8edbe66c8e8f4bb9caefe /include/asm-i386 | |
parent | 3671df8572a299acff9c9cac2bf7279ee614d154 (diff) |
[PATCH] i386: Implement alternative_io for i386
Ported from x86-64.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/alternative.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index 277467329583..0f70b379b029 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -82,6 +82,21 @@ static inline void alternatives_smp_switch(int smp) {} | |||
82 | "663:\n\t" newinstr "\n664:\n" /* replacement */\ | 82 | "663:\n\t" newinstr "\n664:\n" /* replacement */\ |
83 | ".previous" :: "i" (feature), ##input) | 83 | ".previous" :: "i" (feature), ##input) |
84 | 84 | ||
85 | /* Like alternative_input, but with a single output argument */ | ||
86 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
87 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
88 | ".section .altinstructions,\"a\"\n" \ | ||
89 | " .align 4\n" \ | ||
90 | " .long 661b\n" /* label */ \ | ||
91 | " .long 663f\n" /* new instruction */ \ | ||
92 | " .byte %c[feat]\n" /* feature bit */ \ | ||
93 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
94 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
95 | ".previous\n" \ | ||
96 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
97 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
98 | ".previous" : output : [feat] "i" (feature), ##input) | ||
99 | |||
85 | /* | 100 | /* |
86 | * Alternative inline assembly for SMP. | 101 | * Alternative inline assembly for SMP. |
87 | * | 102 | * |