1 Index: linux-2.4.35.4/arch/mips/kernel/signal.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/arch/mips/kernel/signal.c
4 +++ linux-2.4.35.4/arch/mips/kernel/signal.c
6 * Copyright (C) 1991, 1992 Linus Torvalds
7 * Copyright (C) 1994 - 1999 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 + * Copyright (C) 2004 Maciej W. Rozycki
11 #include <linux/config.h>
12 +#include <linux/compiler.h>
13 #include <linux/sched.h>
15 #include <linux/smp.h>
16 @@ -76,7 +78,9 @@ int copy_siginfo_to_user(siginfo_t *to,
17 * Atomically swap in the new signal mask, and wait for a signal.
19 save_static_function(sys_sigsuspend);
20 -static_unused int _sys_sigsuspend(struct pt_regs regs)
21 +static int _sys_sigsuspend(struct pt_regs regs)
22 + __asm__("_sys_sigsuspend") __attribute_used__;
23 +static int _sys_sigsuspend(struct pt_regs regs)
25 sigset_t *uset, saveset, newset;
27 @@ -102,7 +106,9 @@ static_unused int _sys_sigsuspend(struct
30 save_static_function(sys_rt_sigsuspend);
31 -static_unused int _sys_rt_sigsuspend(struct pt_regs regs)
32 +static int _sys_rt_sigsuspend(struct pt_regs regs)
33 + __asm__("_sys_rt_sigsuspend") __attribute_used__;
34 +static int _sys_rt_sigsuspend(struct pt_regs regs)
36 sigset_t *unewset, saveset, newset;
38 Index: linux-2.4.35.4/arch/mips/kernel/syscall.c
39 ===================================================================
40 --- linux-2.4.35.4.orig/arch/mips/kernel/syscall.c
41 +++ linux-2.4.35.4/arch/mips/kernel/syscall.c
44 * Copyright (C) 1995 - 2000 by Ralf Baechle
45 * Copyright (C) 2000 Silicon Graphics, Inc.
46 + * Copyright (C) 2004 Maciej W. Rozycki
48 * TODO: Implement the compatibility syscalls.
49 * Don't waste that much memory for empty entries in the syscall
50 @@ -158,7 +159,9 @@ sys_mmap2(unsigned long addr, unsigned l
53 save_static_function(sys_fork);
54 -static_unused int _sys_fork(struct pt_regs regs)
55 +static int _sys_fork(struct pt_regs regs)
56 + __asm__("_sys_fork") __attribute_used__;
57 +static int _sys_fork(struct pt_regs regs)
61 @@ -168,7 +171,9 @@ static_unused int _sys_fork(struct pt_re
64 save_static_function(sys_clone);
65 -static_unused int _sys_clone(struct pt_regs regs)
66 +static int _sys_clone(struct pt_regs regs)
67 + __asm__("_sys_clone") __attribute_used__;
68 +static int _sys_clone(struct pt_regs regs)
70 unsigned long clone_flags;
72 Index: linux-2.4.35.4/arch/mips/ld.script.in
73 ===================================================================
74 --- linux-2.4.35.4.orig/arch/mips/ld.script.in
75 +++ linux-2.4.35.4/arch/mips/ld.script.in
76 @@ -9,6 +9,7 @@ SECTIONS
84 Index: linux-2.4.35.4/arch/mips64/kernel/signal.c
85 ===================================================================
86 --- linux-2.4.35.4.orig/arch/mips64/kernel/signal.c
87 +++ linux-2.4.35.4/arch/mips64/kernel/signal.c
89 * Copyright (C) 1991, 1992 Linus Torvalds
90 * Copyright (C) 1994 - 2000 Ralf Baechle
91 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
92 + * Copyright (C) 2004 Maciej W. Rozycki
94 #include <linux/config.h>
95 +#include <linux/compiler.h>
96 #include <linux/sched.h>
98 #include <linux/smp.h>
99 @@ -75,7 +77,9 @@ int copy_siginfo_to_user(siginfo_t *to,
100 * Atomically swap in the new signal mask, and wait for a signal.
102 save_static_function(sys_rt_sigsuspend);
103 -static_unused int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
104 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
105 + __asm__("_sys_rt_sigsuspend") __attribute_used__;
106 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
108 sigset_t *unewset, saveset, newset;
110 Index: linux-2.4.35.4/arch/mips64/kernel/signal32.c
111 ===================================================================
112 --- linux-2.4.35.4.orig/arch/mips64/kernel/signal32.c
113 +++ linux-2.4.35.4/arch/mips64/kernel/signal32.c
115 * Copyright (C) 1991, 1992 Linus Torvalds
116 * Copyright (C) 1994 - 2000 Ralf Baechle
117 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
118 + * Copyright (C) 2004 Maciej W. Rozycki
120 +#include <linux/compiler.h>
121 #include <linux/sched.h>
122 #include <linux/mm.h>
123 #include <linux/smp.h>
124 @@ -192,7 +194,9 @@ static inline int get_sigset(sigset_t *k
125 * Atomically swap in the new signal mask, and wait for a signal.
127 save_static_function(sys32_sigsuspend);
128 -static_unused int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
129 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
130 + __asm__("_sys32_sigsuspend") __attribute_used__;
131 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
134 sigset_t newset, saveset;
135 @@ -219,7 +223,9 @@ static_unused int _sys32_sigsuspend(abi6
138 save_static_function(sys32_rt_sigsuspend);
139 -static_unused int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
140 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
141 + __asm__("_sys32_rt_sigsuspend") __attribute_used__;
142 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
145 sigset_t newset, saveset;
146 Index: linux-2.4.35.4/arch/mips64/kernel/syscall.c
147 ===================================================================
148 --- linux-2.4.35.4.orig/arch/mips64/kernel/syscall.c
149 +++ linux-2.4.35.4/arch/mips64/kernel/syscall.c
151 * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
152 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
153 * Copyright (C) 2001 MIPS Technologies, Inc.
154 + * Copyright (C) 2004 Maciej W. Rozycki
156 +#include <linux/compiler.h>
157 #include <linux/errno.h>
158 #include <linux/linkage.h>
159 #include <linux/mm.h>
160 @@ -151,7 +153,9 @@ out:
163 save_static_function(sys_fork);
164 -static_unused int _sys_fork(abi64_no_regargs, struct pt_regs regs)
165 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
166 + __asm__("_sys_fork") __attribute_used__;
167 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
171 @@ -160,7 +164,9 @@ static_unused int _sys_fork(abi64_no_reg
174 save_static_function(sys_clone);
175 -static_unused int _sys_clone(abi64_no_regargs, struct pt_regs regs)
176 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
177 + __asm__("_sys_clone") __attribute_used__;
178 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
180 unsigned long clone_flags;
182 Index: linux-2.4.35.4/include/asm-mips/ptrace.h
183 ===================================================================
184 --- linux-2.4.35.4.orig/include/asm-mips/ptrace.h
185 +++ linux-2.4.35.4/include/asm-mips/ptrace.h
189 * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
190 + * Copyright (C) 2004 Maciej W. Rozycki
192 * Machine dependent structs and defines to help the user use
193 * the ptrace system call.
194 @@ -64,12 +65,10 @@ __asm__ (
195 "sw\t$22,"__str(PT_R22)"($29)\n\t" \
196 "sw\t$23,"__str(PT_R23)"($29)\n\t" \
197 "sw\t$30,"__str(PT_R30)"($29)\n\t" \
198 + "j\t_" #symbol "\n\t" \
199 ".end\t" #symbol "\n\t" \
200 ".size\t" #symbol",. - " #symbol)
202 -/* Used in declaration of save_static functions. */
203 -#define static_unused static __attribute__((unused))
205 #endif /* !__ASSEMBLY__ */
207 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
208 Index: linux-2.4.35.4/include/asm-mips64/ptrace.h
209 ===================================================================
210 --- linux-2.4.35.4.orig/include/asm-mips64/ptrace.h
211 +++ linux-2.4.35.4/include/asm-mips64/ptrace.h
214 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
215 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
216 + * Copyright (C) 2004 Maciej W. Rozycki
218 #ifndef _ASM_PTRACE_H
219 #define _ASM_PTRACE_H
220 @@ -61,12 +62,10 @@ __asm__ (
221 "sd\t$22,"__str(PT_R22)"($29)\n\t" \
222 "sd\t$23,"__str(PT_R23)"($29)\n\t" \
223 "sd\t$30,"__str(PT_R30)"($29)\n\t" \
224 + "j\t_" #symbol "\n\t" \
225 ".end\t" #symbol "\n\t" \
226 ".size\t" #symbol",. - " #symbol)
228 -/* Used in declaration of save_static functions. */
229 -#define static_unused static __attribute__((unused))
231 #define abi64_no_regargs \
232 unsigned long __dummy0, \
233 unsigned long __dummy1, \