b790c02dbddaa0e2706514668792593b821f8af6
[linux-2.6-microblaze.git] / arch / riscv / include / asm / asm-extable.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef __ASM_ASM_EXTABLE_H
3 #define __ASM_ASM_EXTABLE_H
4
5 #ifdef __ASSEMBLY__
6
7 #define __ASM_EXTABLE_RAW(insn, fixup)          \
8         .pushsection    __ex_table, "a";        \
9         .balign         4;                      \
10         .long           ((insn) - .);           \
11         .long           ((fixup) - .);          \
12         .popsection;
13
14         .macro          _asm_extable, insn, fixup
15         __ASM_EXTABLE_RAW(\insn, \fixup)
16         .endm
17
18 #else /* __ASSEMBLY__ */
19
20 #include <linux/stringify.h>
21
22 #define __ASM_EXTABLE_RAW(insn, fixup)                  \
23         ".pushsection   __ex_table, \"a\"\n"            \
24         ".balign        4\n"                            \
25         ".long          ((" insn ") - .)\n"             \
26         ".long          ((" fixup ") - .)\n"            \
27         ".popsection\n"
28
29 #define _ASM_EXTABLE(insn, fixup) __ASM_EXTABLE_RAW(#insn, #fixup)
30
31 #endif /* __ASSEMBLY__ */
32
33 #endif /* __ASM_ASM_EXTABLE_H */