0001
0002 #ifndef _ASM_S390_ALTERNATIVE_ASM_H
0003 #define _ASM_S390_ALTERNATIVE_ASM_H
0004
0005 #ifdef __ASSEMBLY__
0006
0007
0008
0009
0010
0011
0012
0013 .macro alt_entry orig_start, orig_end, alt_start, alt_end, feature
0014 .long \orig_start - .
0015 .long \alt_start - .
0016 .word \feature
0017 .byte \orig_end - \orig_start
0018 .org . - ( \orig_end - \orig_start ) + ( \alt_end - \alt_start )
0019 .org . - ( \alt_end - \alt_start ) + ( \orig_end - \orig_start )
0020 .endm
0021
0022
0023
0024
0025
0026
0027 .macro ALTERNATIVE oldinstr, newinstr, feature
0028 .pushsection .altinstr_replacement,"ax"
0029 770: \newinstr
0030 771: .popsection
0031 772: \oldinstr
0032 773: .pushsection .altinstructions,"a"
0033 alt_entry 772b, 773b, 770b, 771b, \feature
0034 .popsection
0035 .endm
0036
0037
0038
0039
0040
0041
0042 .macro ALTERNATIVE_2 oldinstr, newinstr1, feature1, newinstr2, feature2
0043 .pushsection .altinstr_replacement,"ax"
0044 770: \newinstr1
0045 771: \newinstr2
0046 772: .popsection
0047 773: \oldinstr
0048 774: .pushsection .altinstructions,"a"
0049 alt_entry 773b, 774b, 770b, 771b,\feature1
0050 alt_entry 773b, 774b, 771b, 772b,\feature2
0051 .popsection
0052 .endm
0053
0054 #endif
0055
0056 #endif