/* Atomically swap in the new signal mask, and wait for a signal.  */
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs *regs)
/* Atomically swap in the new signal mask, and wait for a signal.  */
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs *regs)
{
	sigset_t saveset;
	mask &= _BLOCKABLE;
	spin_lock_irq(&current->sighand->siglock);
	saveset = current->blocked;
	siginitset(&current->blocked, mask);
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);
	REF_REG_RET = -EINTR;
	while (1) {
		current->state = TASK_INTERRUPTIBLE;
		schedule();
		set_restore_sigmask();
		regs->pc += 4;
		if (do_signal(regs, &saveset)) {
			regs->pc -= 4;
			return -EINTR;
		}
	}
}