mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect
... and switch i386 to HAVE_SYSCALL_WRAPPERS, killing open-coded uses of asmlinkage_protect() in a bunch of syscalls. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
22d1a35da0
commit
2cf0966683
9 changed files with 31 additions and 89 deletions
|
@ -99,6 +99,7 @@ struct sigaltstack;
|
|||
#define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL))
|
||||
#define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a
|
||||
#define __SC_CAST(t, a) (t) a
|
||||
#define __SC_ARGS(t, a) a
|
||||
#define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
|
||||
|
||||
#ifdef CONFIG_FTRACE_SYSCALLS
|
||||
|
@ -200,13 +201,16 @@ extern struct trace_event_functions exit_syscall_print_funcs;
|
|||
|
||||
#define SYSCALL_DEFINE(name) static inline long SYSC_##name
|
||||
|
||||
#define __PROTECT(...) asmlinkage_protect(__VA_ARGS__)
|
||||
#define __SYSCALL_DEFINEx(x, name, ...) \
|
||||
asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
|
||||
static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
|
||||
asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
|
||||
{ \
|
||||
long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \
|
||||
__MAP(x,__SC_TEST,__VA_ARGS__); \
|
||||
return SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \
|
||||
__PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
|
||||
return ret; \
|
||||
} \
|
||||
SYSCALL_ALIAS(sys##name, SyS##name); \
|
||||
static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue