diff options
29 files changed, 44 insertions, 209 deletions
diff --git a/arch/alpha/include/asm/linkage.h b/arch/alpha/include/asm/linkage.h index 291c2d01c44f..7cfd06e8c935 100644 --- a/arch/alpha/include/asm/linkage.h +++ b/arch/alpha/include/asm/linkage.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_LINKAGE_H | 1 | #ifndef __ASM_LINKAGE_H |
2 | #define __ASM_LINKAGE_H | 2 | #define __ASM_LINKAGE_H |
3 | 3 | ||
4 | /* Nothing to see here... */ | 4 | #define cond_syscall(x) asm(".weak\t" #x "\n" #x " = sys_ni_syscall") |
5 | #define SYSCALL_ALIAS(alias, name) \ | ||
6 | asm ( #alias " = " #name "\n\t.globl " #alias) | ||
5 | 7 | ||
6 | #endif | 8 | #endif |
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 6d6fe7ab5473..43baee17acdf 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h | |||
@@ -18,16 +18,4 @@ | |||
18 | #define __ARCH_WANT_SYS_VFORK | 18 | #define __ARCH_WANT_SYS_VFORK |
19 | #define __ARCH_WANT_SYS_CLONE | 19 | #define __ARCH_WANT_SYS_CLONE |
20 | 20 | ||
21 | /* "Conditional" syscalls. What we want is | ||
22 | |||
23 | __attribute__((weak,alias("sys_ni_syscall"))) | ||
24 | |||
25 | but that raises the problem of what type to give the symbol. If we use | ||
26 | a prototype, it'll conflict with the definition given in this file and | ||
27 | others. If we use __typeof, we discover that not all symbols actually | ||
28 | have declarations. If we use no prototype, then we get warnings from | ||
29 | -Wstrict-prototypes. Ho hum. */ | ||
30 | |||
31 | #define cond_syscall(x) asm(".weak\t" #x "\n" #x " = sys_ni_syscall") | ||
32 | |||
33 | #endif /* _ALPHA_UNISTD_H */ | 21 | #endif /* _ALPHA_UNISTD_H */ |
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index e4ddfb39ca34..141baa3f9a72 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
@@ -44,14 +44,6 @@ | |||
44 | #define __ARCH_WANT_SYS_CLONE | 44 | #define __ARCH_WANT_SYS_CLONE |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * "Conditional" syscalls | ||
48 | * | ||
49 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
50 | * but it doesn't work on all toolchains, so we just do it by hand | ||
51 | */ | ||
52 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
53 | |||
54 | /* | ||
55 | * Unimplemented (or alternatively implemented) syscalls | 47 | * Unimplemented (or alternatively implemented) syscalls |
56 | */ | 48 | */ |
57 | #define __IGNORE_fadvise64_64 | 49 | #define __IGNORE_fadvise64_64 |
diff --git a/arch/avr32/include/asm/unistd.h b/arch/avr32/include/asm/unistd.h index dc4d5a931112..c1eb080e45fe 100644 --- a/arch/avr32/include/asm/unistd.h +++ b/arch/avr32/include/asm/unistd.h | |||
@@ -41,12 +41,4 @@ | |||
41 | #define __ARCH_WANT_SYS_VFORK | 41 | #define __ARCH_WANT_SYS_VFORK |
42 | #define __ARCH_WANT_SYS_CLONE | 42 | #define __ARCH_WANT_SYS_CLONE |
43 | 43 | ||
44 | /* | ||
45 | * "Conditional" syscalls | ||
46 | * | ||
47 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
48 | * but it doesn't work on all toolchains, so we just do it by hand | ||
49 | */ | ||
50 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | ||
51 | |||
52 | #endif /* __ASM_AVR32_UNISTD_H */ | 44 | #endif /* __ASM_AVR32_UNISTD_H */ |
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h index 04e83ea8d5cc..c35414bdf7bd 100644 --- a/arch/blackfin/include/asm/unistd.h +++ b/arch/blackfin/include/asm/unistd.h | |||
@@ -20,12 +20,4 @@ | |||
20 | #define __ARCH_WANT_SYS_NICE | 20 | #define __ARCH_WANT_SYS_NICE |
21 | #define __ARCH_WANT_SYS_VFORK | 21 | #define __ARCH_WANT_SYS_VFORK |
22 | 22 | ||
23 | /* | ||
24 | * "Conditional" syscalls | ||
25 | * | ||
26 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
27 | * but it doesn't work on all toolchains, so we just do it by hand | ||
28 | */ | ||
29 | #define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall"); | ||
30 | |||
31 | #endif /* __ASM_BFIN_UNISTD_H */ | 23 | #endif /* __ASM_BFIN_UNISTD_H */ |
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h index be57a988bfb9..0ff3f6889842 100644 --- a/arch/cris/include/asm/unistd.h +++ b/arch/cris/include/asm/unistd.h | |||
@@ -34,12 +34,4 @@ | |||
34 | #define __ARCH_WANT_SYS_VFORK | 34 | #define __ARCH_WANT_SYS_VFORK |
35 | #define __ARCH_WANT_SYS_CLONE | 35 | #define __ARCH_WANT_SYS_CLONE |
36 | 36 | ||
37 | /* | ||
38 | * "Conditional" syscalls | ||
39 | * | ||
40 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
41 | * but it doesn't work on all toolchains, so we just do it by hand | ||
42 | */ | ||
43 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
44 | |||
45 | #endif /* _ASM_CRIS_UNISTD_H_ */ | 37 | #endif /* _ASM_CRIS_UNISTD_H_ */ |
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h index 4cfcc7bba25a..70ec7293dce7 100644 --- a/arch/frv/include/asm/unistd.h +++ b/arch/frv/include/asm/unistd.h | |||
@@ -31,14 +31,4 @@ | |||
31 | #define __ARCH_WANT_SYS_VFORK | 31 | #define __ARCH_WANT_SYS_VFORK |
32 | #define __ARCH_WANT_SYS_CLONE | 32 | #define __ARCH_WANT_SYS_CLONE |
33 | 33 | ||
34 | /* | ||
35 | * "Conditional" syscalls | ||
36 | * | ||
37 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
38 | * but it doesn't work on all toolchains, so we just do it by hand | ||
39 | */ | ||
40 | #ifndef cond_syscall | ||
41 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
42 | #endif | ||
43 | |||
44 | #endif /* _ASM_UNISTD_H_ */ | 34 | #endif /* _ASM_UNISTD_H_ */ |
diff --git a/arch/h8300/include/asm/linkage.h b/arch/h8300/include/asm/linkage.h index 6f4df7d46180..1d81604fb0ad 100644 --- a/arch/h8300/include/asm/linkage.h +++ b/arch/h8300/include/asm/linkage.h | |||
@@ -2,7 +2,5 @@ | |||
2 | #define _H8300_LINKAGE_H | 2 | #define _H8300_LINKAGE_H |
3 | 3 | ||
4 | #undef SYMBOL_NAME_LABEL | 4 | #undef SYMBOL_NAME_LABEL |
5 | #undef SYMBOL_NAME | ||
6 | #define SYMBOL_NAME_LABEL(_name_) _##_name_##: | 5 | #define SYMBOL_NAME_LABEL(_name_) _##_name_##: |
7 | #define SYMBOL_NAME(_name_) _##_name_ | ||
8 | #endif | 6 | #endif |
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index 6721856d841b..ab671ecf5196 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h | |||
@@ -33,11 +33,4 @@ | |||
33 | #define __ARCH_WANT_SYS_VFORK | 33 | #define __ARCH_WANT_SYS_VFORK |
34 | #define __ARCH_WANT_SYS_CLONE | 34 | #define __ARCH_WANT_SYS_CLONE |
35 | 35 | ||
36 | /* | ||
37 | * "Conditional" syscalls | ||
38 | */ | ||
39 | #define cond_syscall(name) \ | ||
40 | asm (".weak\t_" #name "\n" \ | ||
41 | ".set\t_" #name ",_sys_ni_syscall"); | ||
42 | |||
43 | #endif /* _ASM_H8300_UNISTD_H_ */ | 36 | #endif /* _ASM_H8300_UNISTD_H_ */ |
diff --git a/arch/ia64/include/asm/linkage.h b/arch/ia64/include/asm/linkage.h index ef22a45c1890..787575701f1c 100644 --- a/arch/ia64/include/asm/linkage.h +++ b/arch/ia64/include/asm/linkage.h | |||
@@ -11,4 +11,8 @@ | |||
11 | 11 | ||
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | #define cond_syscall(x) asm(".weak\t" #x "#\n" #x "#\t=\tsys_ni_syscall#") | ||
15 | #define SYSCALL_ALIAS(alias, name) \ | ||
16 | asm ( #alias "# = " #name "#\n\t.globl " #alias "#") | ||
17 | |||
14 | #endif | 18 | #endif |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 096373800f73..afd45e0d552e 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -46,15 +46,5 @@ asmlinkage unsigned long sys_mmap2( | |||
46 | struct pt_regs; | 46 | struct pt_regs; |
47 | asmlinkage long sys_ia64_pipe(void); | 47 | asmlinkage long sys_ia64_pipe(void); |
48 | 48 | ||
49 | /* | ||
50 | * "Conditional" syscalls | ||
51 | * | ||
52 | * Note, this macro can only be used in the file which defines sys_ni_syscall, i.e., in | ||
53 | * kernel/sys_ni.c. This version causes warnings because the declaration isn't a | ||
54 | * proper prototype, but we can't use __typeof__ either, because not all cond_syscall() | ||
55 | * declarations have prototypes at the moment. | ||
56 | */ | ||
57 | #define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall"))) | ||
58 | |||
59 | #endif /* !__ASSEMBLY__ */ | 49 | #endif /* !__ASSEMBLY__ */ |
60 | #endif /* _ASM_IA64_UNISTD_H */ | 50 | #endif /* _ASM_IA64_UNISTD_H */ |
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h index 555629b05267..59db80193454 100644 --- a/arch/m32r/include/asm/unistd.h +++ b/arch/m32r/include/asm/unistd.h | |||
@@ -48,14 +48,4 @@ | |||
48 | #define __IGNORE_getresgid | 48 | #define __IGNORE_getresgid |
49 | #define __IGNORE_chown | 49 | #define __IGNORE_chown |
50 | 50 | ||
51 | /* | ||
52 | * "Conditional" syscalls | ||
53 | * | ||
54 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
55 | * but it doesn't work on all toolchains, so we just do it by hand | ||
56 | */ | ||
57 | #ifndef cond_syscall | ||
58 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
59 | #endif | ||
60 | |||
61 | #endif /* _ASM_M32R_UNISTD_H */ | 51 | #endif /* _ASM_M32R_UNISTD_H */ |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 6cd92671ca5e..014f288fc813 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -32,12 +32,4 @@ | |||
32 | #define __ARCH_WANT_SYS_FORK | 32 | #define __ARCH_WANT_SYS_FORK |
33 | #define __ARCH_WANT_SYS_VFORK | 33 | #define __ARCH_WANT_SYS_VFORK |
34 | 34 | ||
35 | /* | ||
36 | * "Conditional" syscalls | ||
37 | * | ||
38 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
39 | * but it doesn't work on all toolchains, so we just do it by hand | ||
40 | */ | ||
41 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
42 | |||
43 | #endif /* _ASM_M68K_UNISTD_H_ */ | 35 | #endif /* _ASM_M68K_UNISTD_H_ */ |
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index b3778391d9cc..6dece2d002dc 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h | |||
@@ -37,13 +37,5 @@ | |||
37 | #define __ARCH_WANT_SYS_VFORK | 37 | #define __ARCH_WANT_SYS_VFORK |
38 | #define __ARCH_WANT_SYS_FORK | 38 | #define __ARCH_WANT_SYS_FORK |
39 | 39 | ||
40 | /* | ||
41 | * "Conditional" syscalls | ||
42 | * | ||
43 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
44 | * but it doesn't work on all toolchains, so we just do it by hand | ||
45 | */ | ||
46 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | ||
47 | |||
48 | #endif /* __ASSEMBLY__ */ | 40 | #endif /* __ASSEMBLY__ */ |
49 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ | 41 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ |
diff --git a/arch/mips/include/asm/linkage.h b/arch/mips/include/asm/linkage.h index e9a940d1b0c6..2767dda9e309 100644 --- a/arch/mips/include/asm/linkage.h +++ b/arch/mips/include/asm/linkage.h | |||
@@ -6,5 +6,8 @@ | |||
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | #define __weak __attribute__((weak)) | 8 | #define __weak __attribute__((weak)) |
9 | #define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") | ||
10 | #define SYSCALL_ALIAS(alias, name) \ | ||
11 | asm ( #alias " = " #name "\n\t.globl " #alias) | ||
9 | 12 | ||
10 | #endif | 13 | #endif |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 64f661e32879..63c9c886173a 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -63,12 +63,4 @@ | |||
63 | 63 | ||
64 | #endif /* !__ASSEMBLY__ */ | 64 | #endif /* !__ASSEMBLY__ */ |
65 | 65 | ||
66 | /* | ||
67 | * "Conditional" syscalls | ||
68 | * | ||
69 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
70 | * but it doesn't work on all toolchains, so we just do it by hand | ||
71 | */ | ||
72 | #define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") | ||
73 | |||
74 | #endif /* _ASM_UNISTD_H */ | 66 | #endif /* _ASM_UNISTD_H */ |
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index 7f9d9adfa51e..9d4e2d1ef90e 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h | |||
@@ -45,14 +45,4 @@ | |||
45 | #define __ARCH_WANT_SYS_VFORK | 45 | #define __ARCH_WANT_SYS_VFORK |
46 | #define __ARCH_WANT_SYS_CLONE | 46 | #define __ARCH_WANT_SYS_CLONE |
47 | 47 | ||
48 | /* | ||
49 | * "Conditional" syscalls | ||
50 | * | ||
51 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
52 | * but it doesn't work on all toolchains, so we just do it by hand | ||
53 | */ | ||
54 | #ifndef cond_syscall | ||
55 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | ||
56 | #endif | ||
57 | |||
58 | #endif /* _ASM_UNISTD_H */ | 48 | #endif /* _ASM_UNISTD_H */ |
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index ae9a46cbfd92..74d835820ee7 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h | |||
@@ -170,12 +170,4 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | |||
170 | 170 | ||
171 | #undef STR | 171 | #undef STR |
172 | 172 | ||
173 | /* | ||
174 | * "Conditional" syscalls | ||
175 | * | ||
176 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
177 | * but it doesn't work on all toolchains, so we just do it by hand | ||
178 | */ | ||
179 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
180 | |||
181 | #endif /* _ASM_PARISC_UNISTD_H_ */ | 173 | #endif /* _ASM_PARISC_UNISTD_H_ */ |
diff --git a/arch/powerpc/include/asm/linkage.h b/arch/powerpc/include/asm/linkage.h new file mode 100644 index 000000000000..b36f650a13ff --- /dev/null +++ b/arch/powerpc/include/asm/linkage.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _ASM_POWERPC_LINKAGE_H | ||
2 | #define _ASM_POWERPC_LINKAGE_H | ||
3 | |||
4 | #ifdef CONFIG_PPC64 | ||
5 | #define cond_syscall(x) \ | ||
6 | asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n" \ | ||
7 | "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n") | ||
8 | #define SYSCALL_ALIAS(alias, name) \ | ||
9 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | ||
10 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | ||
11 | #endif | ||
12 | |||
13 | #endif /* _ASM_POWERPC_LINKAGE_H */ | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index f25b5c45c435..91586d979c99 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -56,11 +56,5 @@ | |||
56 | #define __ARCH_WANT_SYS_VFORK | 56 | #define __ARCH_WANT_SYS_VFORK |
57 | #define __ARCH_WANT_SYS_CLONE | 57 | #define __ARCH_WANT_SYS_CLONE |
58 | 58 | ||
59 | /* | ||
60 | * "Conditional" syscalls | ||
61 | */ | ||
62 | #define cond_syscall(x) \ | ||
63 | asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall"))) | ||
64 | |||
65 | #endif /* __ASSEMBLY__ */ | 59 | #endif /* __ASSEMBLY__ */ |
66 | #endif /* _ASM_POWERPC_UNISTD_H_ */ | 60 | #endif /* _ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/include/uapi/asm/linkage.h b/arch/powerpc/include/uapi/asm/linkage.h deleted file mode 100644 index e1c4ac1cc4ba..000000000000 --- a/arch/powerpc/include/uapi/asm/linkage.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_LINKAGE_H | ||
2 | #define _ASM_POWERPC_LINKAGE_H | ||
3 | |||
4 | /* Nothing to see here... */ | ||
5 | |||
6 | #endif /* _ASM_POWERPC_LINKAGE_H */ | ||
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index a6667a952969..651886353551 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h | |||
@@ -54,12 +54,4 @@ | |||
54 | #define __ARCH_WANT_SYS_VFORK | 54 | #define __ARCH_WANT_SYS_VFORK |
55 | #define __ARCH_WANT_SYS_CLONE | 55 | #define __ARCH_WANT_SYS_CLONE |
56 | 56 | ||
57 | /* | ||
58 | * "Conditional" syscalls | ||
59 | * | ||
60 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
61 | * but it doesn't work on all toolchains, so we just do it by hand | ||
62 | */ | ||
63 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
64 | |||
65 | #endif /* _ASM_S390_UNISTD_H_ */ | 57 | #endif /* _ASM_S390_UNISTD_H_ */ |
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index 5e90fa2b7eed..e77816c4b9bc 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h | |||
@@ -30,12 +30,4 @@ | |||
30 | # define __ARCH_WANT_SYS_VFORK | 30 | # define __ARCH_WANT_SYS_VFORK |
31 | # define __ARCH_WANT_SYS_CLONE | 31 | # define __ARCH_WANT_SYS_CLONE |
32 | 32 | ||
33 | /* | ||
34 | * "Conditional" syscalls | ||
35 | * | ||
36 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
37 | * but it doesn't work on all toolchains, so we just do it by hand | ||
38 | */ | ||
39 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
40 | |||
41 | #include <uapi/asm/unistd.h> | 33 | #include <uapi/asm/unistd.h> |
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 5356810bd7e7..dfa53fdd5cbc 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h | |||
@@ -45,12 +45,4 @@ | |||
45 | #define __ARCH_WANT_COMPAT_SYS_SENDFILE | 45 | #define __ARCH_WANT_COMPAT_SYS_SENDFILE |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | /* | ||
49 | * "Conditional" syscalls | ||
50 | * | ||
51 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
52 | * but it doesn't work on all toolchains, so we just do it by hand | ||
53 | */ | ||
54 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
55 | |||
56 | #endif /* _SPARC_UNISTD_H */ | 48 | #endif /* _SPARC_UNISTD_H */ |
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 3d5df1c4447f..c2a48139c340 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h | |||
@@ -50,12 +50,4 @@ | |||
50 | # define __ARCH_WANT_SYS_VFORK | 50 | # define __ARCH_WANT_SYS_VFORK |
51 | # define __ARCH_WANT_SYS_CLONE | 51 | # define __ARCH_WANT_SYS_CLONE |
52 | 52 | ||
53 | /* | ||
54 | * "Conditional" syscalls | ||
55 | * | ||
56 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
57 | * but it doesn't work on all toolchains, so we just do it by hand | ||
58 | */ | ||
59 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
60 | |||
61 | #endif /* _ASM_X86_UNISTD_H */ | 53 | #endif /* _ASM_X86_UNISTD_H */ |
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index c38834de9ac7..cb4c2ce8d447 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h | |||
@@ -4,14 +4,6 @@ | |||
4 | #define __ARCH_WANT_SYS_CLONE | 4 | #define __ARCH_WANT_SYS_CLONE |
5 | #include <uapi/asm/unistd.h> | 5 | #include <uapi/asm/unistd.h> |
6 | 6 | ||
7 | /* | ||
8 | * "Conditional" syscalls | ||
9 | * | ||
10 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
11 | * but it doesn't work on all toolchains, so we just do it by hand | ||
12 | */ | ||
13 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | ||
14 | |||
15 | #define __ARCH_WANT_STAT64 | 7 | #define __ARCH_WANT_STAT64 |
16 | #define __ARCH_WANT_SYS_UTIME | 8 | #define __ARCH_WANT_SYS_UTIME |
17 | #define __ARCH_WANT_SYS_LLSEEK | 9 | #define __ARCH_WANT_SYS_LLSEEK |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 4077b5d9ff81..0501fa3f783d 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -9,20 +9,3 @@ | |||
9 | #define __ARCH_WANT_STAT64 | 9 | #define __ARCH_WANT_STAT64 |
10 | #define __ARCH_WANT_SYS_LLSEEK | 10 | #define __ARCH_WANT_SYS_LLSEEK |
11 | #endif | 11 | #endif |
12 | |||
13 | /* | ||
14 | * "Conditional" syscalls | ||
15 | * | ||
16 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
17 | * but it doesn't work on all toolchains, so we just do it by hand | ||
18 | */ | ||
19 | #ifndef cond_syscall | ||
20 | #ifdef CONFIG_SYMBOL_PREFIX | ||
21 | #define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
22 | #else | ||
23 | #define __SYMBOL_PREFIX | ||
24 | #endif | ||
25 | #define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \ | ||
26 | ".set\t" __SYMBOL_PREFIX #x "," \ | ||
27 | __SYMBOL_PREFIX "sys_ni_syscall") | ||
28 | #endif | ||
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 807f1e533226..829d66c67fc2 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_LINKAGE_H | 2 | #define _LINUX_LINKAGE_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/stringify.h> | ||
5 | #include <asm/linkage.h> | 6 | #include <asm/linkage.h> |
6 | 7 | ||
7 | #ifdef __cplusplus | 8 | #ifdef __cplusplus |
@@ -14,6 +15,26 @@ | |||
14 | #define asmlinkage CPP_ASMLINKAGE | 15 | #define asmlinkage CPP_ASMLINKAGE |
15 | #endif | 16 | #endif |
16 | 17 | ||
18 | #ifndef SYMBOL_NAME | ||
19 | #ifdef CONFIG_SYMBOL_PREFIX | ||
20 | #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x | ||
21 | #else | ||
22 | #define SYMBOL_NAME(x) x | ||
23 | #endif | ||
24 | #endif | ||
25 | #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x)) | ||
26 | |||
27 | #ifndef cond_syscall | ||
28 | #define cond_syscall(x) asm(".weak\t" __SYMBOL_NAME(x) \ | ||
29 | "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); | ||
30 | #endif | ||
31 | |||
32 | #ifndef SYSCALL_ALIAS | ||
33 | #define SYSCALL_ALIAS(alias, name) \ | ||
34 | asm ("\t.globl " __SYMBOL_NAME(alias) \ | ||
35 | "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) | ||
36 | #endif | ||
37 | |||
17 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) | 38 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) |
18 | #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) | 39 | #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) |
19 | 40 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 3e07b92efbf6..87584373305d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -183,20 +183,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
183 | #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__) | 183 | #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__) |
184 | #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) | 184 | #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) |
185 | 185 | ||
186 | #ifdef CONFIG_PPC64 | ||
187 | #define SYSCALL_ALIAS(alias, name) \ | ||
188 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | ||
189 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | ||
190 | #else | ||
191 | #if defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) | ||
192 | #define SYSCALL_ALIAS(alias, name) \ | ||
193 | asm ( #alias " = " #name "\n\t.globl " #alias) | ||
194 | #else | ||
195 | #define SYSCALL_ALIAS(alias, name) \ | ||
196 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) | ||
197 | #endif | ||
198 | #endif | ||
199 | |||
200 | #ifdef CONFIG_FTRACE_SYSCALLS | 186 | #ifdef CONFIG_FTRACE_SYSCALLS |
201 | #define SYSCALL_DEFINEx(x, sname, ...) \ | 187 | #define SYSCALL_DEFINEx(x, sname, ...) \ |
202 | static const char *types_##sname[] = { \ | 188 | static const char *types_##sname[] = { \ |