Lines Matching +full:alternative +full:- +full:a
1 /* SPDX-License-Identifier: GPL-2.0 */
23 * Alternative inline assembly for SMP.
29 * alternatives and the X86_FEATURE_UP flag to indicate the case of a
30 * UP system running a SMP kernel. The existing apply_alternatives()
31 * works fine for patching a SMP kernel for UP.
33 * The SMP alternative tables can be kept after boot and contain both
35 * SMP at runtime, when hotplugging in a new CPU, which is especially
38 * The very common lock prefix is handled as special case in a
39 * separate table which is a pure address list without replacement ptr
45 ".pushsection .smp_locks,\"a\"\n" \
47 ".long 671f - .\n" /* offset */ \
65 * extended in the future to fit in a u64 or however the need arises.
86 * Debug flag that can be tested to see whether alternative
150 #define alt_slen "772b-771b"
151 #define alt_total_slen "773b-771b"
152 #define alt_rlen "775f-774f"
158 ".skip -(((" alt_rlen ")-(" alt_slen ")) > 0) * " \
159 "((" alt_rlen ")-(" alt_slen ")),0x90\n" \
163 ".pushsection .altinstructions,\"a\"\n" \
164 " .long 771b - .\n" /* label */ \
165 " .long 774f - .\n" /* new instruction */ \
177 /* alternative assembly primitive: */
178 #define ALTERNATIVE(oldinstr, newinstr, ft_flags) \ macro
184 ALTERNATIVE(ALTERNATIVE(oldinstr, newinstr1, ft_flags1), newinstr2, ft_flags2)
192 ALTERNATIVE(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2), \
196 * Alternative instructions for different CPU types or capabilities.
207 #define alternative(oldinstr, newinstr, ft_flags) \ macro
208 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory")
214 * Alternative inline assembly with input.
222 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
225 /* Like alternative_input, but with a single output argument */
227 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
231 * Like alternative_io, but for replacing a direct call with another one.
233 * Use the %c operand modifier which is the generic way to print a bare
234 * constant expression with all syntax-specific punctuation omitted. %P
235 * is the x86-specific variant which can handle constants too, for
237 * references: i.e., if used for a function, it would add the PLT
241 asm_inline volatile(ALTERNATIVE("call %c[old]", "call %c[new]", ft_flags) \
263 #define ASM_OUTPUT2(a...) a argument
283 ".size " #func ", . - " #func "\n\t" \
294 .pushsection .smp_locks,"a"
296 .long 672b - .
311 .long \orig - .
312 .long \alt - .
323 * Define an alternative between two instructions. If @feature is
332 .skip -(((744f-743f)-(741b-740b)) > 0) * ((744f-743f)-(741b-740b)),0x90 ;\
334 .pushsection .altinstructions,"a" ; \
335 altinstr_entry 740b,743f,flag,742b-740b,744f-743f ; \
343 .macro ALTERNATIVE oldinstr, newinstr, ft_flags
347 #define old_len 141b-140b
348 #define new_len1 144f-143f
349 #define new_len2 145f-144f
350 #define new_len3 146f-145f
353 * Same as ALTERNATIVE macro above but for two alternatives. If CPU