diff options
-rw-r--r-- | include/asm-x86_64/system.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index a3bca7552e14..80272190570e 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -137,6 +137,21 @@ struct alt_instr { | |||
137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | 137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ |
138 | ".previous" :: "i" (feature), ##input) | 138 | ".previous" :: "i" (feature), ##input) |
139 | 139 | ||
140 | /* Like alternative_input, but with a single output argument */ | ||
141 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
142 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
143 | ".section .altinstructions,\"a\"\n" \ | ||
144 | " .align 8\n" \ | ||
145 | " .quad 661b\n" /* label */ \ | ||
146 | " .quad 663f\n" /* new instruction */ \ | ||
147 | " .byte %c[feat]\n" /* feature bit */ \ | ||
148 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
149 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
150 | ".previous\n" \ | ||
151 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
152 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
153 | ".previous" : output : [feat] "i" (feature), ##input) | ||
154 | |||
140 | /* | 155 | /* |
141 | * Clear and set 'TS' bit respectively | 156 | * Clear and set 'TS' bit respectively |
142 | */ | 157 | */ |