File tree Expand file tree Collapse file tree 3 files changed +49
-41
lines changed Expand file tree Collapse file tree 3 files changed +49
-41
lines changed Original file line number Diff line number Diff line change
1
+ #ifdef CONFIG_64BIT
2
+ GEN (rax )
3
+ GEN (rbx )
4
+ GEN (rcx )
5
+ GEN (rdx )
6
+ GEN (rsi )
7
+ GEN (rdi )
8
+ GEN (rbp )
9
+ GEN (r8 )
10
+ GEN (r9 )
11
+ GEN (r10 )
12
+ GEN (r11 )
13
+ GEN (r12 )
14
+ GEN (r13 )
15
+ GEN (r14 )
16
+ GEN (r15 )
17
+ #else
18
+ GEN (eax )
19
+ GEN (ebx )
20
+ GEN (ecx )
21
+ GEN (edx )
22
+ GEN (esi )
23
+ GEN (edi )
24
+ GEN (ebp )
25
+ #endif
Original file line number Diff line number Diff line change @@ -17,24 +17,12 @@ extern void cmpxchg8b_emu(void);
17
17
#endif
18
18
19
19
#ifdef CONFIG_RETPOLINE
20
- #ifdef CONFIG_X86_32
21
- #define INDIRECT_THUNK (reg ) extern asmlinkage void __x86_indirect_thunk_e ## reg(void);
22
- #else
23
- #define INDIRECT_THUNK (reg ) extern asmlinkage void __x86_indirect_thunk_r ## reg(void);
24
- INDIRECT_THUNK (8 )
25
- INDIRECT_THUNK (9 )
26
- INDIRECT_THUNK (10 )
27
- INDIRECT_THUNK (11 )
28
- INDIRECT_THUNK (12 )
29
- INDIRECT_THUNK (13 )
30
- INDIRECT_THUNK (14 )
31
- INDIRECT_THUNK (15 )
32
- #endif
33
- INDIRECT_THUNK (ax )
34
- INDIRECT_THUNK (bx )
35
- INDIRECT_THUNK (cx )
36
- INDIRECT_THUNK (dx )
37
- INDIRECT_THUNK (si )
38
- INDIRECT_THUNK (di )
39
- INDIRECT_THUNK (bp )
20
+
21
+ #define DECL_INDIRECT_THUNK (reg ) \
22
+ extern asmlinkage void __x86_indirect_thunk_ ## reg (void);
23
+
24
+ #undef GEN
25
+ #define GEN (reg ) DECL_INDIRECT_THUNK(reg)
26
+ #include <asm/GEN-for-each-reg.h>
27
+
40
28
#endif /* CONFIG_RETPOLINE */
Original file line number Diff line number Diff line change @@ -24,25 +24,20 @@ SYM_FUNC_END(__x86_indirect_thunk_\reg)
24
24
* only see one instance of "__x86_indirect_thunk_\reg" rather
25
25
* than one per register with the correct names. So we do it
26
26
* the simple and nasty way...
27
+ *
28
+ * Worse, you can only have a single EXPORT_SYMBOL per line,
29
+ * and CPP can't insert newlines, so we have to repeat everything
30
+ * at least twice.
27
31
*/
28
- #define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym); EXPORT_SYMBOL(sym)
29
- #define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg)
30
- #define GENERATE_THUNK(reg) THUNK reg ; EXPORT_THUNK(reg)
31
-
32
- GENERATE_THUNK(_ASM_AX)
33
- GENERATE_THUNK(_ASM_BX)
34
- GENERATE_THUNK(_ASM_CX)
35
- GENERATE_THUNK(_ASM_DX)
36
- GENERATE_THUNK(_ASM_SI)
37
- GENERATE_THUNK(_ASM_DI)
38
- GENERATE_THUNK(_ASM_BP)
39
- #ifdef CONFIG_64BIT
40
- GENERATE_THUNK(r8)
41
- GENERATE_THUNK(r9)
42
- GENERATE_THUNK(r10)
43
- GENERATE_THUNK(r11)
44
- GENERATE_THUNK(r12)
45
- GENERATE_THUNK(r13)
46
- GENERATE_THUNK(r14)
47
- GENERATE_THUNK(r15)
48
- #endif
32
+
33
+ #define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym); EXPORT_SYMBOL(sym)
34
+ #define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg)
35
+
36
+ #undef GEN
37
+ #define GEN(reg) THUNK reg
38
+ #include <asm/GEN-for-each-reg.h>
39
+
40
+ #undef GEN
41
+ #define GEN(reg) EXPORT_THUNK(reg)
42
+ #include <asm/GEN-for-each-reg.h>
43
+
You can’t perform that action at this time.
0 commit comments