1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_S390_NOSPEC_ASM_H
3 #define _ASM_S390_NOSPEC_ASM_H
9 #ifdef CC_USING_EXPOLINE
12 * The expoline macros are used to create thunks in the same format
13 * as gcc generates them. The 'comdat' section flag makes sure that
14 * the various thunks are merged into a single copy.
16 .macro __THUNK_PROLOG_NAME name
17 #ifdef CONFIG_EXPOLINE_EXTERN
18 .pushsection .text,"ax",@progbits
21 .pushsection .text.\name,"axG",@progbits,\name,comdat
30 .macro __THUNK_EPILOG_NAME name
32 #ifdef CONFIG_EXPOLINE_EXTERN
38 .macro __THUNK_PROLOG_BR r1
39 __THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
42 .macro __THUNK_EPILOG_BR r1
43 __THUNK_EPILOG_NAME __s390_indirect_jump_r\r1
47 jg __s390_indirect_jump_r\r1
50 .macro __THUNK_BRASL r1,r2
51 brasl \r1,__s390_indirect_jump_r\r2
54 .macro __DECODE_R expand,reg
55 .set .L__decode_fail,1
56 .irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
59 .set .L__decode_fail,0
62 .if .L__decode_fail == 1
63 .error "__DECODE_R failed"
67 .macro __DECODE_RR expand,rsave,rtarget
68 .set .L__decode_fail,1
69 .irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
71 .irp r2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
74 .set .L__decode_fail,0
79 .if .L__decode_fail == 1
80 .error "__DECODE_RR failed"
84 .macro __THUNK_EX_BR reg
90 #ifdef CONFIG_EXPOLINE_EXTERN
91 .macro GEN_BR_THUNK reg
93 .macro GEN_BR_THUNK_EXTERN reg
95 .macro GEN_BR_THUNK reg
97 __DECODE_R __THUNK_PROLOG_BR,\reg
99 __DECODE_R __THUNK_EPILOG_BR,\reg
103 557: __DECODE_R __THUNK_BR,\reg
104 .pushsection .s390_indirect_branches,"a",@progbits
109 .macro BASR_EX rsave,rtarget
110 559: __DECODE_RR __THUNK_BRASL,\rsave,\rtarget
111 .pushsection .s390_indirect_branches,"a",@progbits
117 .macro GEN_BR_THUNK reg
124 .macro BASR_EX rsave,rtarget
127 #endif /* CC_USING_EXPOLINE */
129 #endif /* __ASSEMBLY__ */
131 #endif /* _ASM_S390_NOSPEC_ASM_H */