1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_S390_ALTERNATIVE_ASM_H
3 #define _ASM_S390_ALTERNATIVE_ASM_H
8 * Issue one struct alt_instr descriptor entry (need to put it into
9 * the section .altinstructions, see below). This entry contains
10 * enough information for the alternatives patching code to patch an
11 * instruction. See apply_alternatives().
13 .macro alt_entry orig_start, orig_end, alt_start, alt_end, feature
17 .byte \orig_end - \orig_start
18 .org . - ( \orig_end - \orig_start ) + ( \alt_end - \alt_start )
19 .org . - ( \alt_end - \alt_start ) + ( \orig_end - \orig_start )
23 * Define an alternative between two instructions. If @feature is
24 * present, early code in apply_alternatives() replaces @oldinstr with
27 .macro ALTERNATIVE oldinstr, newinstr, feature
28 .pushsection .altinstr_replacement,"ax"
32 773: .pushsection .altinstructions,"a"
33 alt_entry 772b, 773b, 770b, 771b, \feature
38 * Define an alternative between two instructions. If @feature is
39 * present, early code in apply_alternatives() replaces @oldinstr with
42 .macro ALTERNATIVE_2 oldinstr, newinstr1, feature1, newinstr2, feature2
43 .pushsection .altinstr_replacement,"ax"
48 774: .pushsection .altinstructions,"a"
49 alt_entry 773b, 774b, 770b, 771b,\feature1
50 alt_entry 773b, 774b, 771b, 772b,\feature2
54 #endif /* __ASSEMBLY__ */
56 #endif /* _ASM_S390_ALTERNATIVE_ASM_H */