diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-06-15 15:18:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-18 11:17:43 -0400 |
commit | cb3504e8fa84870aabcf51c67e29675817e30836 (patch) | |
tree | 7c46380f8672e87ecc40cecb004772f5301ea0f8 /arch/arm/kernel/signal.c | |
parent | 7d4fdc19fc134f69f3711c14e63caef56aee0f2a (diff) |
[ARM] Re-use sigframe within rt_sigframe
sigframe is now a contained subset of rt_sigframe, so we can start
to re-use code which accesses sigframe data for both rt and non-rt
signals.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/signal.c')
-rw-r--r-- | arch/arm/kernel/signal.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 9f1e1768e4a6..652bb1a33c06 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -200,9 +200,7 @@ struct sigframe { | |||
200 | 200 | ||
201 | struct rt_sigframe { | 201 | struct rt_sigframe { |
202 | struct siginfo info; | 202 | struct siginfo info; |
203 | struct ucontext uc; | 203 | struct sigframe sig; |
204 | unsigned long retcode[2]; | ||
205 | struct aux_sigframe aux __attribute__((aligned(8))); | ||
206 | }; | 204 | }; |
207 | 205 | ||
208 | static int | 206 | static int |
@@ -308,7 +306,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
308 | 306 | ||
309 | if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) | 307 | if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) |
310 | goto badframe; | 308 | goto badframe; |
311 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 309 | if (__copy_from_user(&set, &frame->sig.uc.uc_sigmask, sizeof(set))) |
312 | goto badframe; | 310 | goto badframe; |
313 | 311 | ||
314 | sigdelsetmask(&set, ~_BLOCKABLE); | 312 | sigdelsetmask(&set, ~_BLOCKABLE); |
@@ -317,10 +315,10 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
317 | recalc_sigpending(); | 315 | recalc_sigpending(); |
318 | spin_unlock_irq(¤t->sighand->siglock); | 316 | spin_unlock_irq(¤t->sighand->siglock); |
319 | 317 | ||
320 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &frame->aux)) | 318 | if (restore_sigcontext(regs, &frame->sig.uc.uc_mcontext, &frame->sig.aux)) |
321 | goto badframe; | 319 | goto badframe; |
322 | 320 | ||
323 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) | 321 | if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) |
324 | goto badframe; | 322 | goto badframe; |
325 | 323 | ||
326 | /* Send SIGTRAP if we're single-stepping */ | 324 | /* Send SIGTRAP if we're single-stepping */ |
@@ -503,21 +501,21 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
503 | 501 | ||
504 | err |= copy_siginfo_to_user(&frame->info, info); | 502 | err |= copy_siginfo_to_user(&frame->info, info); |
505 | 503 | ||
506 | __put_user_error(0, &frame->uc.uc_flags, err); | 504 | __put_user_error(0, &frame->sig.uc.uc_flags, err); |
507 | __put_user_error(NULL, &frame->uc.uc_link, err); | 505 | __put_user_error(NULL, &frame->sig.uc.uc_link, err); |
508 | 506 | ||
509 | memset(&stack, 0, sizeof(stack)); | 507 | memset(&stack, 0, sizeof(stack)); |
510 | stack.ss_sp = (void __user *)current->sas_ss_sp; | 508 | stack.ss_sp = (void __user *)current->sas_ss_sp; |
511 | stack.ss_flags = sas_ss_flags(regs->ARM_sp); | 509 | stack.ss_flags = sas_ss_flags(regs->ARM_sp); |
512 | stack.ss_size = current->sas_ss_size; | 510 | stack.ss_size = current->sas_ss_size; |
513 | err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack)); | 511 | err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack)); |
514 | 512 | ||
515 | err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->aux, | 513 | err |= setup_sigcontext(&frame->sig.uc.uc_mcontext, &frame->sig.aux, |
516 | regs, set->sig[0]); | 514 | regs, set->sig[0]); |
517 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 515 | err |= __copy_to_user(&frame->sig.uc.uc_sigmask, set, sizeof(*set)); |
518 | 516 | ||
519 | if (err == 0) | 517 | if (err == 0) |
520 | err = setup_return(regs, ka, frame->retcode, frame, usig); | 518 | err = setup_return(regs, ka, frame->sig.retcode, frame, usig); |
521 | 519 | ||
522 | if (err == 0) { | 520 | if (err == 0) { |
523 | /* | 521 | /* |
@@ -526,7 +524,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
526 | * -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06 | 524 | * -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06 |
527 | */ | 525 | */ |
528 | regs->ARM_r1 = (unsigned long)&frame->info; | 526 | regs->ARM_r1 = (unsigned long)&frame->info; |
529 | regs->ARM_r2 = (unsigned long)&frame->uc; | 527 | regs->ARM_r2 = (unsigned long)&frame->sig.uc; |
530 | } | 528 | } |
531 | 529 | ||
532 | return err; | 530 | return err; |