aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/ppc32.h9
-rw-r--r--arch/powerpc/kernel/signal_32.c65
2 files changed, 0 insertions, 74 deletions
diff --git a/arch/powerpc/kernel/ppc32.h b/arch/powerpc/kernel/ppc32.h
index fe92b0d0603a..a27c914d5802 100644
--- a/arch/powerpc/kernel/ppc32.h
+++ b/arch/powerpc/kernel/ppc32.h
@@ -16,15 +16,6 @@
16 16
17/* These are here to support 32-bit syscalls on a 64-bit kernel. */ 17/* These are here to support 32-bit syscalls on a 64-bit kernel. */
18 18
19#define __old_sigaction32 old_sigaction32
20
21struct __old_sigaction32 {
22 compat_uptr_t sa_handler;
23 compat_old_sigset_t sa_mask;
24 unsigned int sa_flags;
25 compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
26};
27
28struct pt_regs32 { 19struct pt_regs32 {
29 unsigned int gpr[32]; 20 unsigned int gpr[32];
30 unsigned int nip; 21 unsigned int nip;
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 16ec1c9899ad..802ab5ea36cb 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -57,7 +57,6 @@
57 57
58#ifdef CONFIG_PPC64 58#ifdef CONFIG_PPC64
59#define sys_rt_sigreturn compat_sys_rt_sigreturn 59#define sys_rt_sigreturn compat_sys_rt_sigreturn
60#define sys_sigaction compat_sys_sigaction
61#define sys_swapcontext compat_sys_swapcontext 60#define sys_swapcontext compat_sys_swapcontext
62#define sys_sigreturn compat_sys_sigreturn 61#define sys_sigreturn compat_sys_sigreturn
63 62
@@ -130,23 +129,6 @@ static inline int get_sigset_t(sigset_t *set,
130 return 0; 129 return 0;
131} 130}
132 131
133static inline int get_old_sigaction(struct k_sigaction *new_ka,
134 struct old_sigaction __user *act)
135{
136 compat_old_sigset_t mask;
137 compat_uptr_t handler, restorer;
138
139 if (get_user(handler, &act->sa_handler) ||
140 __get_user(restorer, &act->sa_restorer) ||
141 __get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
142 __get_user(mask, &act->sa_mask))
143 return -EFAULT;
144 new_ka->sa.sa_handler = compat_ptr(handler);
145 new_ka->sa.sa_restorer = compat_ptr(restorer);
146 siginitset(&new_ka->sa.sa_mask, mask);
147 return 0;
148}
149
150#define to_user_ptr(p) ptr_to_compat(p) 132#define to_user_ptr(p) ptr_to_compat(p)
151#define from_user_ptr(p) compat_ptr(p) 133#define from_user_ptr(p) compat_ptr(p)
152 134
@@ -196,21 +178,6 @@ static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset)
196 return copy_from_user(set, uset, sizeof(*uset)); 178 return copy_from_user(set, uset, sizeof(*uset));
197} 179}
198 180
199static inline int get_old_sigaction(struct k_sigaction *new_ka,
200 struct old_sigaction __user *act)
201{
202 old_sigset_t mask;
203
204 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
205 __get_user(new_ka->sa.sa_handler, &act->sa_handler) ||
206 __get_user(new_ka->sa.sa_restorer, &act->sa_restorer) ||
207 __get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
208 __get_user(mask, &act->sa_mask))
209 return -EFAULT;
210 siginitset(&new_ka->sa.sa_mask, mask);
211 return 0;
212}
213
214#define to_user_ptr(p) ((unsigned long)(p)) 181#define to_user_ptr(p) ((unsigned long)(p))
215#define from_user_ptr(p) ((void __user *)(p)) 182#define from_user_ptr(p) ((void __user *)(p))
216 183
@@ -234,40 +201,8 @@ static inline int restore_general_regs(struct pt_regs *regs,
234 return -EFAULT; 201 return -EFAULT;
235 return 0; 202 return 0;
236} 203}
237
238#endif /* CONFIG_PPC64 */
239
240long sys_sigaction(int sig, struct old_sigaction __user *act,
241 struct old_sigaction __user *oact)
242{
243 struct k_sigaction new_ka, old_ka;
244 int ret;
245
246#ifdef CONFIG_PPC64
247 if (sig < 0)
248 sig = -sig;
249#endif 204#endif
250 205
251 if (act) {
252 if (get_old_sigaction(&new_ka, act))
253 return -EFAULT;
254 }
255
256 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
257 if (!ret && oact) {
258 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
259 __put_user(to_user_ptr(old_ka.sa.sa_handler),
260 &oact->sa_handler) ||
261 __put_user(to_user_ptr(old_ka.sa.sa_restorer),
262 &oact->sa_restorer) ||
263 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
264 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
265 return -EFAULT;
266 }
267
268 return ret;
269}
270
271/* 206/*
272 * When we have signals to deliver, we set up on the 207 * When we have signals to deliver, we set up on the
273 * user stack, going down from the original stack pointer: 208 * user stack, going down from the original stack pointer: