aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/syscalls.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d7168b3a4b4c..70fcda1a9049 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -223,21 +223,26 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
223 223
224#define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) 224#define __PROTECT(...) asmlinkage_protect(__VA_ARGS__)
225 225
226/*
227 * The asmlinkage stub is aliased to a function named __se_sys_*() which
228 * sign-extends 32-bit ints to longs whenever needed. The actual work is
229 * done within __do_sys_*().
230 */
226#ifndef __SYSCALL_DEFINEx 231#ifndef __SYSCALL_DEFINEx
227#define __SYSCALL_DEFINEx(x, name, ...) \ 232#define __SYSCALL_DEFINEx(x, name, ...) \
228 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 233 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
229 __attribute__((alias(__stringify(SyS##name)))); \ 234 __attribute__((alias(__stringify(__se_sys##name)))); \
230 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ 235 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
231 static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 236 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
232 asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ 237 asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
233 asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ 238 asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
234 { \ 239 { \
235 long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \ 240 long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
236 __MAP(x,__SC_TEST,__VA_ARGS__); \ 241 __MAP(x,__SC_TEST,__VA_ARGS__); \
237 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ 242 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
238 return ret; \ 243 return ret; \
239 } \ 244 } \
240 static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 245 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
241#endif /* __SYSCALL_DEFINEx */ 246#endif /* __SYSCALL_DEFINEx */
242 247
243/* 248/*