aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/alternative.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 0a3f9c9f98d5..473bdbee378a 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -161,6 +161,20 @@ static inline int alternatives_text_reserved(void *start, void *end)
161 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ 161 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
162 : : "i" (0), ## input) 162 : : "i" (0), ## input)
163 163
164/*
165 * This is similar to alternative_input. But it has two features and
166 * respective instructions.
167 *
168 * If CPU has feature2, newinstr2 is used.
169 * Otherwise, if CPU has feature1, newinstr1 is used.
170 * Otherwise, oldinstr is used.
171 */
172#define alternative_input_2(oldinstr, newinstr1, feature1, newinstr2, \
173 feature2, input...) \
174 asm volatile(ALTERNATIVE_2(oldinstr, newinstr1, feature1, \
175 newinstr2, feature2) \
176 : : "i" (0), ## input)
177
164/* Like alternative_input, but with a single output argument */ 178/* Like alternative_input, but with a single output argument */
165#define alternative_io(oldinstr, newinstr, feature, output, input...) \ 179#define alternative_io(oldinstr, newinstr, feature, output, input...) \
166 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ 180 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \