diff options
Diffstat (limited to 'include/asm-i386/alternative.h')
-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 | * |