1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_S390_NOSPEC_ASM_H
3 #define _ASM_S390_NOSPEC_ASM_H
5 #include <linux/linkage.h>
10 #ifdef CC_USING_EXPOLINE
13 * The expoline macros are used to create thunks in the same format
14 * as gcc generates them. The 'comdat' section flag makes sure that
15 * the various thunks are merged into a single copy.
17 .macro __THUNK_PROLOG_NAME name
18 #ifdef CONFIG_EXPOLINE_EXTERN
21 .pushsection .text.\name,"axG",@progbits,\name,comdat
30 .macro __THUNK_EPILOG_NAME name
31 #ifdef CONFIG_EXPOLINE_EXTERN
40 .macro __THUNK_PROLOG_BR r1
41 __THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
44 .macro __THUNK_EPILOG_BR r1
45 __THUNK_EPILOG_NAME __s390_indirect_jump_r\r1
49 jg __s390_indirect_jump_r\r1
52 .macro __THUNK_BRASL r1,r2
53 brasl \r1,__s390_indirect_jump_r\r2
56 .macro __DECODE_R expand,reg
57 .set .L__decode_fail,1
58 .irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
61 .set .L__decode_fail,0
64 .if .L__decode_fail == 1
65 .error "__DECODE_R failed"
69 .macro __DECODE_RR expand,rsave,rtarget
70 .set .L__decode_fail,1
71 .irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
73 .irp r2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
76 .set .L__decode_fail,0
81 .if .L__decode_fail == 1
82 .error "__DECODE_RR failed"
86 .macro __THUNK_EX_BR reg
92 #ifdef CONFIG_EXPOLINE_EXTERN
93 .macro GEN_BR_THUNK reg
95 .macro GEN_BR_THUNK_EXTERN reg
97 .macro GEN_BR_THUNK reg
99 __DECODE_R __THUNK_PROLOG_BR,\reg
101 __DECODE_R __THUNK_EPILOG_BR,\reg
105 557: __DECODE_R __THUNK_BR,\reg
106 .pushsection .s390_indirect_branches,"a",@progbits
111 .macro BASR_EX rsave,rtarget
112 559: __DECODE_RR __THUNK_BRASL,\rsave,\rtarget
113 .pushsection .s390_indirect_branches,"a",@progbits
119 .macro GEN_BR_THUNK reg
126 .macro BASR_EX rsave,rtarget
129 #endif /* CC_USING_EXPOLINE */
131 #endif /* __ASSEMBLY__ */
133 #endif /* _ASM_S390_NOSPEC_ASM_H */