Lines Matching +full:alternative +full:- +full:b

1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Each alternative comes with a 32 bit feature field:
17 * in which context an alternative is supposed to be applied to the
20 * - from the decompressor before the kernel itself is executed
21 * - from early kernel code from within the kernel
24 * specific alternative patching.
27 * alternative should be applied.
67 u32 type : 8; /* type of alternative */
89 * +---------------------------------+
92 * +---------------------------------+
95 * +---------------------------------+
97 * | alternative instr 1 |
98 * +---------------------------------+
100 * | alternative instr 2 |
101 * +---------------------------------+
104 * +---------------------------------+
106 * | alternative instr |
107 * +---------------------------------+
112 #define oldinstr_len "662b-661b"
113 #define altinstr_len(num) e_altinstr(num)"b-"b_altinstr(num)"b"
119 "\t.long 661b - .\n" /* old instruction */ \
120 "\t.long " b_altinstr(num)"b - .\n" /* alt instruction */ \
123 "\t.org . - (" oldinstr_len ") & 1\n" \
124 "\t.org . - (" oldinstr_len ") + (" altinstr_len(num) ")\n" \
125 "\t.org . - (" altinstr_len(num) ") + (" oldinstr_len ")\n"
130 /* alternative assembly primitive: */
131 #define ALTERNATIVE(oldinstr, altinstr, feature) \
152 * Alternative instructions for different CPU types or capabilities.
158 * longer. altinstr is padded with jump and nops at run-time during patching.
163 #define alternative(oldinstr, altinstr, feature) \
164 asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, feature) : : : "memory")
170 /* Alternative inline assembly with input. */
172 asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
177 asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, feature) \
195 .long \orig_start - .
196 .long \alt_start - .
198 .byte \orig_end - \orig_start
199 .org . - ( \orig_end - \orig_start ) & 1
200 .org . - ( \orig_end - \orig_start ) + ( \alt_end - \alt_start )
201 .org . - ( \alt_end - \alt_start ) + ( \orig_end - \orig_start )
205 * Define an alternative between two instructions. If @feature is
209 .macro ALTERNATIVE oldinstr, newinstr, feature
215 alt_entry 772b, 773b, 770b, 771b, \feature
220 * Define an alternative between two instructions. If @feature is
231 alt_entry 773b, 774b, 770b, 771b,\feature1
232 alt_entry 773b, 774b, 771b, 772b,\feature2