Skip to content

Commit e1b5bb6

Browse files
author
Al Viro
committed
consolidate cond_syscall and SYSCALL_ALIAS declarations
take them to asm/linkage.h, with default in linux/linkage.h Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 4a0fd5b commit e1b5bb6

29 files changed

Lines changed: 44 additions & 209 deletions

File tree

‎arch/alpha/include/asm/linkage.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef __ASM_LINKAGE_H
22
#define __ASM_LINKAGE_H
33

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)
57

68
#endif

‎arch/alpha/include/asm/unistd.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,4 @@
1818
#define __ARCH_WANT_SYS_VFORK
1919
#define __ARCH_WANT_SYS_CLONE
2020

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-
3321
#endif /* _ALPHA_UNISTD_H */

‎arch/arm/include/asm/unistd.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@
4343
#define __ARCH_WANT_SYS_VFORK
4444
#define __ARCH_WANT_SYS_CLONE
4545

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-
5446
/*
5547
* Unimplemented (or alternatively implemented) syscalls
5648
*/

‎arch/avr32/include/asm/unistd.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,4 @@
4141
#define __ARCH_WANT_SYS_VFORK
4242
#define __ARCH_WANT_SYS_CLONE
4343

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-
5244
#endif /* __ASM_AVR32_UNISTD_H */

‎arch/blackfin/include/asm/unistd.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,4 @@
2020
#define __ARCH_WANT_SYS_NICE
2121
#define __ARCH_WANT_SYS_VFORK
2222

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-
3123
#endif /* __ASM_BFIN_UNISTD_H */

‎arch/cris/include/asm/unistd.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,4 @@
3434
#define __ARCH_WANT_SYS_VFORK
3535
#define __ARCH_WANT_SYS_CLONE
3636

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-
4537
#endif /* _ASM_CRIS_UNISTD_H_ */

‎arch/frv/include/asm/unistd.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,4 @@
3131
#define __ARCH_WANT_SYS_VFORK
3232
#define __ARCH_WANT_SYS_CLONE
3333

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-
4434
#endif /* _ASM_UNISTD_H_ */

‎arch/h8300/include/asm/linkage.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
#define _H8300_LINKAGE_H
33

44
#undef SYMBOL_NAME_LABEL
5-
#undef SYMBOL_NAME
65
#define SYMBOL_NAME_LABEL(_name_) _##_name_##:
7-
#define SYMBOL_NAME(_name_) _##_name_
86
#endif

‎arch/h8300/include/asm/unistd.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,4 @@
3333
#define __ARCH_WANT_SYS_VFORK
3434
#define __ARCH_WANT_SYS_CLONE
3535

36-
/*
37-
* "Conditional" syscalls
38-
*/
39-
#define cond_syscall(name) \
40-
asm (".weak\t_" #name "\n" \
41-
".set\t_" #name ",_sys_ni_syscall");
42-
4336
#endif /* _ASM_H8300_UNISTD_H_ */

‎arch/ia64/include/asm/linkage.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111

1212
#endif
1313

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+
1418
#endif

0 commit comments

Comments
 (0)