File tree Expand file tree Collapse file tree 4 files changed +37
-10
lines changed Expand file tree Collapse file tree 4 files changed +37
-10
lines changed Original file line number Diff line number Diff line change
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 */
Original file line number Diff line number Diff line change 11
11
#include <linux/uaccess.h>
12
12
#include <linux/errno.h>
13
13
#include <asm/asm.h>
14
+ #include <asm/asm-extable.h>
14
15
15
16
/* We don't even really need the extable code, but for now keep it simple */
16
17
#ifndef CONFIG_MMU
Original file line number Diff line number Diff line change 8
8
#ifndef _ASM_RISCV_UACCESS_H
9
9
#define _ASM_RISCV_UACCESS_H
10
10
11
+ #include <asm/asm-extable.h>
11
12
#include <asm/pgtable.h> /* for TASK_SIZE */
12
13
13
- #define _ASM_EXTABLE (from , to ) \
14
- " .pushsection __ex_table, \"a\"\n" \
15
- " .balign 4\n" \
16
- " .long (" #from " - .), (" #to " - .)\n" \
17
- " .popsection\n"
18
-
19
14
/*
20
15
* User space memory access functions
21
16
*/
Original file line number Diff line number Diff line change 1
1
#include <linux/linkage.h>
2
2
#include <asm-generic/export.h>
3
3
#include <asm/asm.h>
4
+ #include <asm/asm-extable.h>
4
5
#include <asm/csr.h>
5
6
6
7
.macro fixup op reg addr lbl
7
8
100 :
8
9
\op \reg , \addr
9
- .section __ex_table,"a"
10
- .balign 4
11
- .long (100b - .), (\lbl - .)
12
- .previous
10
+ _asm_extable 100b, \lbl
13
11
.endm
14
12
15
13
ENTRY (__asm_copy_to_user)
You can’t perform that action at this time.
0 commit comments