]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
syscalls.h: use gcc alias instead of assembler aliases for syscalls
authorAndi Kleen <ak@linux.intel.com>
Tue, 5 Nov 2013 05:56:04 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:04 +0000 (16:56 +1100)
Use standard gcc __attribute__((alias(foo))) to define the syscall aliases
instead of custom assembler macros.

This is far cleaner, and also fixes my LTO kernel build.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/compat.h
include/linux/syscalls.h

index 345da00a86e07c0c5cd5cf7de50c5155c5a758d5..ada34c92b6843c72b87221781f2b610ebfac325e 100644 (file)
        COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
 
 #define COMPAT_SYSCALL_DEFINEx(x, name, ...)                           \
-       asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
+       asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\
+               __attribute__((alias(__stringify(compat_SyS##name))));  \
        static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
        asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\
        asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\
        {                                                               \
                return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
        }                                                               \
-       SYSCALL_ALIAS(compat_sys##name, compat_SyS##name);              \
        static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
 #ifndef compat_user_stack_pointer
index 7fac04e7ff6eac91f4d8a37d30486892e1dac141..c27f846f6b71ae10cc5a98de630f55e898b2c8e5 100644 (file)
@@ -184,7 +184,8 @@ extern struct trace_event_functions exit_syscall_print_funcs;
 
 #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__)
 #define __SYSCALL_DEFINEx(x, name, ...)                                        \
-       asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));      \
+       asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))       \
+               __attribute__((alias(__stringify(SyS##name))));         \
        static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));  \
        asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));      \
        asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))       \
@@ -194,7 +195,6 @@ extern struct trace_event_functions exit_syscall_print_funcs;
                __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__))
 
 asmlinkage long sys_time(time_t __user *tloc);