-
- switch (_NSIG_WORDS) {
-#ifdef __MIPSEB__
- case 4: these.sig[3] = these32.sig[6] | (((long)these32.sig[7]) << 32);
- case 3: these.sig[2] = these32.sig[4] | (((long)these32.sig[5]) << 32);
- case 2: these.sig[1] = these32.sig[2] | (((long)these32.sig[3]) << 32);
- case 1: these.sig[0] = these32.sig[0] | (((long)these32.sig[1]) << 32);
-#endif
-#ifdef __MIPSEL__
- case 4: these.sig[3] = these32.sig[7] | (((long)these32.sig[6]) << 32);
- case 3: these.sig[2] = these32.sig[5] | (((long)these32.sig[4]) << 32);
- case 2: these.sig[1] = these32.sig[3] | (((long)these32.sig[2]) << 32);
- case 1: these.sig[0] = these32.sig[1] | (((long)these32.sig[0]) << 32);
-#endif
- }
-
- /*
- * Invert the set of allowed signals to get those we
- * want to block.
- */
- sigdelsetmask(&these, sigmask(SIGKILL)|sigmask(SIGSTOP));
- signotset(&these);
-
- if (uts) {
- if (get_user (ts.tv_sec, &uts->tv_sec) ||
- get_user (ts.tv_nsec, &uts->tv_nsec))
- return -EINVAL;
- if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0
- || ts.tv_sec < 0)
- return -EINVAL;
- }
-
- spin_lock_irq(¤t->sighand->siglock);
- sig = dequeue_signal(current, &these, &info);
- if (!sig) {
- /* None ready -- temporarily unblock those we're interested
- in so that we'll be awakened when they arrive. */
- sigset_t oldblocked = current->blocked;
- sigandsets(¤t->blocked, ¤t->blocked, &these);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
-
- timeout = MAX_SCHEDULE_TIMEOUT;
- if (uts)
- timeout = (timespec_to_jiffies(&ts)
- + (ts.tv_sec || ts.tv_nsec));
-
- current->state = TASK_INTERRUPTIBLE;
- timeout = schedule_timeout(timeout);
-
- spin_lock_irq(¤t->sighand->siglock);
- sig = dequeue_signal(current, &these, &info);
- current->blocked = oldblocked;
- recalc_sigpending();
- }
- spin_unlock_irq(¤t->sighand->siglock);
-
- if (sig) {
- ret = sig;
- if (uinfo) {
- if (copy_siginfo_to_user32(uinfo, &info))
- ret = -EFAULT;
- }
- } else {
- ret = -EAGAIN;
- if (timeout)
- ret = -EINTR;
- }
-