aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32/ia32_signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/ia32/ia32_signal.c')
-rw-r--r--arch/ia64/ia32/ia32_signal.c59
1 files changed, 10 insertions, 49 deletions
diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index 7b38b73e7827..b2bb7f227920 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -452,59 +452,20 @@ sigact_set_handler (struct k_sigaction *sa, unsigned int handler, unsigned int r
452 sa->sa.sa_handler = (__sighandler_t) (((unsigned long) restorer << 32) | handler); 452 sa->sa.sa_handler = (__sighandler_t) (((unsigned long) restorer << 32) | handler);
453} 453}
454 454
455long 455asmlinkage long
456__ia32_rt_sigsuspend (compat_sigset_t *sset, unsigned int sigsetsize, struct sigscratch *scr) 456sys32_sigsuspend (int history0, int history1, old_sigset_t mask)
457{ 457{
458 extern long ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall); 458 mask &= _BLOCKABLE;
459 sigset_t oldset, set;
460
461 scr->scratch_unat = 0; /* avoid leaking kernel bits to user level */
462 memset(&set, 0, sizeof(set));
463
464 memcpy(&set.sig, &sset->sig, sigsetsize);
465
466 sigdelsetmask(&set, ~_BLOCKABLE);
467
468 spin_lock_irq(&current->sighand->siglock); 459 spin_lock_irq(&current->sighand->siglock);
469 { 460 current->saved_sigmask = current->blocked;
470 oldset = current->blocked; 461 siginitset(&current->blocked, mask);
471 current->blocked = set; 462 recalc_sigpending();
472 recalc_sigpending();
473 }
474 spin_unlock_irq(&current->sighand->siglock); 463 spin_unlock_irq(&current->sighand->siglock);
475 464
476 /* 465 current->state = TASK_INTERRUPTIBLE;
477 * The return below usually returns to the signal handler. We need to pre-set the 466 schedule();
478 * correct error code here to ensure that the right values get saved in sigcontext 467 set_thread_flag(TIF_RESTORE_SIGMASK);
479 * by ia64_do_signal. 468 return -ERESTARTNOHAND;
480 */
481 scr->pt.r8 = -EINTR;
482 while (1) {
483 current->state = TASK_INTERRUPTIBLE;
484 schedule();
485 if (ia64_do_signal(&oldset, scr, 1))
486 return -EINTR;
487 }
488}
489
490asmlinkage long
491ia32_rt_sigsuspend (compat_sigset_t __user *uset, unsigned int sigsetsize, struct sigscratch *scr)
492{
493 compat_sigset_t set;
494
495 if (sigsetsize > sizeof(compat_sigset_t))
496 return -EINVAL;
497
498 if (copy_from_user(&set.sig, &uset->sig, sigsetsize))
499 return -EFAULT;
500
501 return __ia32_rt_sigsuspend(&set, sigsetsize, scr);
502}
503
504asmlinkage long
505ia32_sigsuspend (unsigned int mask, struct sigscratch *scr)
506{
507 return __ia32_rt_sigsuspend((compat_sigset_t *) &mask, sizeof(mask), scr);
508} 469}
509 470
510asmlinkage long 471asmlinkage long