1 --- a/arch/mips/kernel/signal.c
2 +++ b/arch/mips/kernel/signal.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 1994 - 1999 Ralf Baechle
6 * Copyright (C) 1999 Silicon Graphics, Inc.
7 + * Copyright (C) 2004 Maciej W. Rozycki
9 #include <linux/config.h>
10 +#include <linux/compiler.h>
11 #include <linux/sched.h>
13 #include <linux/smp.h>
14 @@ -76,7 +78,9 @@ int copy_siginfo_to_user(siginfo_t *to,
15 * Atomically swap in the new signal mask, and wait for a signal.
17 save_static_function(sys_sigsuspend);
18 -static_unused int _sys_sigsuspend(struct pt_regs regs)
19 +static int _sys_sigsuspend(struct pt_regs regs)
20 + __asm__("_sys_sigsuspend") __attribute_used__;
21 +static int _sys_sigsuspend(struct pt_regs regs)
23 sigset_t *uset, saveset, newset;
25 @@ -102,7 +106,9 @@ static_unused int _sys_sigsuspend(struct
28 save_static_function(sys_rt_sigsuspend);
29 -static_unused int _sys_rt_sigsuspend(struct pt_regs regs)
30 +static int _sys_rt_sigsuspend(struct pt_regs regs)
31 + __asm__("_sys_rt_sigsuspend") __attribute_used__;
32 +static int _sys_rt_sigsuspend(struct pt_regs regs)
34 sigset_t *unewset, saveset, newset;
36 --- a/arch/mips/kernel/syscall.c
37 +++ b/arch/mips/kernel/syscall.c
40 * Copyright (C) 1995 - 2000 by Ralf Baechle
41 * Copyright (C) 2000 Silicon Graphics, Inc.
42 + * Copyright (C) 2004 Maciej W. Rozycki
44 * TODO: Implement the compatibility syscalls.
45 * Don't waste that much memory for empty entries in the syscall
46 @@ -158,7 +159,9 @@ sys_mmap2(unsigned long addr, unsigned l
49 save_static_function(sys_fork);
50 -static_unused int _sys_fork(struct pt_regs regs)
51 +static int _sys_fork(struct pt_regs regs)
52 + __asm__("_sys_fork") __attribute_used__;
53 +static int _sys_fork(struct pt_regs regs)
57 @@ -168,7 +171,9 @@ static_unused int _sys_fork(struct pt_re
60 save_static_function(sys_clone);
61 -static_unused int _sys_clone(struct pt_regs regs)
62 +static int _sys_clone(struct pt_regs regs)
63 + __asm__("_sys_clone") __attribute_used__;
64 +static int _sys_clone(struct pt_regs regs)
66 unsigned long clone_flags;
68 --- a/arch/mips/ld.script.in
69 +++ b/arch/mips/ld.script.in
70 @@ -9,6 +9,7 @@ SECTIONS
78 --- a/arch/mips64/kernel/signal.c
79 +++ b/arch/mips64/kernel/signal.c
81 * Copyright (C) 1991, 1992 Linus Torvalds
82 * Copyright (C) 1994 - 2000 Ralf Baechle
83 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
84 + * Copyright (C) 2004 Maciej W. Rozycki
86 #include <linux/config.h>
87 +#include <linux/compiler.h>
88 #include <linux/sched.h>
90 #include <linux/smp.h>
91 @@ -75,7 +77,9 @@ int copy_siginfo_to_user(siginfo_t *to,
92 * Atomically swap in the new signal mask, and wait for a signal.
94 save_static_function(sys_rt_sigsuspend);
95 -static_unused int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
96 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
97 + __asm__("_sys_rt_sigsuspend") __attribute_used__;
98 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
100 sigset_t *unewset, saveset, newset;
102 --- a/arch/mips64/kernel/signal32.c
103 +++ b/arch/mips64/kernel/signal32.c
105 * Copyright (C) 1991, 1992 Linus Torvalds
106 * Copyright (C) 1994 - 2000 Ralf Baechle
107 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
108 + * Copyright (C) 2004 Maciej W. Rozycki
110 +#include <linux/compiler.h>
111 #include <linux/sched.h>
112 #include <linux/mm.h>
113 #include <linux/smp.h>
114 @@ -192,7 +194,9 @@ static inline int get_sigset(sigset_t *k
115 * Atomically swap in the new signal mask, and wait for a signal.
117 save_static_function(sys32_sigsuspend);
118 -static_unused int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
119 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
120 + __asm__("_sys32_sigsuspend") __attribute_used__;
121 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
124 sigset_t newset, saveset;
125 @@ -219,7 +223,9 @@ static_unused int _sys32_sigsuspend(abi6
128 save_static_function(sys32_rt_sigsuspend);
129 -static_unused int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
130 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
131 + __asm__("_sys32_rt_sigsuspend") __attribute_used__;
132 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
135 sigset_t newset, saveset;
136 --- a/arch/mips64/kernel/syscall.c
137 +++ b/arch/mips64/kernel/syscall.c
139 * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
140 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
141 * Copyright (C) 2001 MIPS Technologies, Inc.
142 + * Copyright (C) 2004 Maciej W. Rozycki
144 +#include <linux/compiler.h>
145 #include <linux/errno.h>
146 #include <linux/linkage.h>
147 #include <linux/mm.h>
148 @@ -151,7 +153,9 @@ out:
151 save_static_function(sys_fork);
152 -static_unused int _sys_fork(abi64_no_regargs, struct pt_regs regs)
153 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
154 + __asm__("_sys_fork") __attribute_used__;
155 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
159 @@ -160,7 +164,9 @@ static_unused int _sys_fork(abi64_no_reg
162 save_static_function(sys_clone);
163 -static_unused int _sys_clone(abi64_no_regargs, struct pt_regs regs)
164 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
165 + __asm__("_sys_clone") __attribute_used__;
166 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
168 unsigned long clone_flags;
170 --- a/include/asm-mips/ptrace.h
171 +++ b/include/asm-mips/ptrace.h
175 * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
176 + * Copyright (C) 2004 Maciej W. Rozycki
178 * Machine dependent structs and defines to help the user use
179 * the ptrace system call.
180 @@ -64,12 +65,10 @@ __asm__ (
181 "sw\t$22,"__str(PT_R22)"($29)\n\t" \
182 "sw\t$23,"__str(PT_R23)"($29)\n\t" \
183 "sw\t$30,"__str(PT_R30)"($29)\n\t" \
184 + "j\t_" #symbol "\n\t" \
185 ".end\t" #symbol "\n\t" \
186 ".size\t" #symbol",. - " #symbol)
188 -/* Used in declaration of save_static functions. */
189 -#define static_unused static __attribute__((unused))
191 #endif /* !__ASSEMBLY__ */
193 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
194 --- a/include/asm-mips64/ptrace.h
195 +++ b/include/asm-mips64/ptrace.h
198 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
199 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
200 + * Copyright (C) 2004 Maciej W. Rozycki
202 #ifndef _ASM_PTRACE_H
203 #define _ASM_PTRACE_H
204 @@ -61,12 +62,10 @@ __asm__ (
205 "sd\t$22,"__str(PT_R22)"($29)\n\t" \
206 "sd\t$23,"__str(PT_R23)"($29)\n\t" \
207 "sd\t$30,"__str(PT_R30)"($29)\n\t" \
208 + "j\t_" #symbol "\n\t" \
209 ".end\t" #symbol "\n\t" \
210 ".size\t" #symbol",. - " #symbol)
212 -/* Used in declaration of save_static functions. */
213 -#define static_unused static __attribute__((unused))
215 #define abi64_no_regargs \
216 unsigned long __dummy0, \
217 unsigned long __dummy1, \