|
28 | 28 | * kernel/sys_ni.c and SYS_NI in kernel/time/posix-stubs.c to cover this
|
29 | 29 | * case as well.
|
30 | 30 | */
|
| 31 | +#define __IA32_COMPAT_SYS_STUB0(x, name) \ |
| 32 | + asmlinkage long __ia32_compat_sys_##name(const struct pt_regs *regs);\ |
| 33 | + ALLOW_ERROR_INJECTION(__ia32_compat_sys_##name, ERRNO); \ |
| 34 | + asmlinkage long __ia32_compat_sys_##name(const struct pt_regs *regs)\ |
| 35 | + { \ |
| 36 | + return __se_compat_sys_##name(); \ |
| 37 | + } |
| 38 | + |
31 | 39 | #define __IA32_COMPAT_SYS_STUBx(x, name, ...) \
|
32 | 40 | asmlinkage long __ia32_compat_sys##name(const struct pt_regs *regs);\
|
33 | 41 | ALLOW_ERROR_INJECTION(__ia32_compat_sys##name, ERRNO); \
|
34 | 42 | asmlinkage long __ia32_compat_sys##name(const struct pt_regs *regs)\
|
35 | 43 | { \
|
36 | 44 | return __se_compat_sys##name(SC_IA32_REGS_TO_ARGS(x,__VA_ARGS__));\
|
37 |
| - } \ |
| 45 | + } |
38 | 46 |
|
39 | 47 | #define __IA32_SYS_STUBx(x, name, ...) \
|
40 | 48 | asmlinkage long __ia32_sys##name(const struct pt_regs *regs); \
|
|
76 | 84 | * of the x86-64-style parameter ordering of x32 syscalls. The syscalls common
|
77 | 85 | * with x86_64 obviously do not need such care.
|
78 | 86 | */
|
| 87 | +#define __X32_COMPAT_SYS_STUB0(x, name, ...) \ |
| 88 | + asmlinkage long __x32_compat_sys_##name(const struct pt_regs *regs);\ |
| 89 | + ALLOW_ERROR_INJECTION(__x32_compat_sys_##name, ERRNO); \ |
| 90 | + asmlinkage long __x32_compat_sys_##name(const struct pt_regs *regs)\ |
| 91 | + { \ |
| 92 | + return __se_compat_sys_##name();\ |
| 93 | + } |
| 94 | + |
79 | 95 | #define __X32_COMPAT_SYS_STUBx(x, name, ...) \
|
80 | 96 | asmlinkage long __x32_compat_sys##name(const struct pt_regs *regs);\
|
81 | 97 | ALLOW_ERROR_INJECTION(__x32_compat_sys##name, ERRNO); \
|
82 | 98 | asmlinkage long __x32_compat_sys##name(const struct pt_regs *regs)\
|
83 | 99 | { \
|
84 | 100 | return __se_compat_sys##name(SC_X86_64_REGS_TO_ARGS(x,__VA_ARGS__));\
|
85 |
| - } \ |
| 101 | + } |
86 | 102 |
|
87 | 103 | #else /* CONFIG_X86_X32 */
|
| 104 | +#define __X32_COMPAT_SYS_STUB0(x, name) |
88 | 105 | #define __X32_COMPAT_SYS_STUBx(x, name, ...)
|
89 | 106 | #endif /* CONFIG_X86_X32 */
|
90 | 107 |
|
|
95 | 112 | * mapping of registers to parameters, we need to generate stubs for each
|
96 | 113 | * of them.
|
97 | 114 | */
|
| 115 | +#define COMPAT_SYSCALL_DEFINE0(name) \ |
| 116 | + static long __se_compat_sys_##name(void); \ |
| 117 | + static inline long __do_compat_sys_##name(void); \ |
| 118 | + __IA32_COMPAT_SYS_STUB0(x, name) \ |
| 119 | + __X32_COMPAT_SYS_STUB0(x, name) \ |
| 120 | + static long __se_compat_sys_##name(void) \ |
| 121 | + { \ |
| 122 | + return __do_compat_sys_##name(); \ |
| 123 | + } \ |
| 124 | + static inline long __do_compat_sys_##name(void) |
| 125 | + |
98 | 126 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
|
99 | 127 | static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
|
100 | 128 | static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
|
|
0 commit comments