sizeof(sr->mc_vregs)))
return 1;
} else if (current->thread.used_vr)
- memset(¤t->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128));
+ memset(current->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128));
/* Always get VRSAVE back */
if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
return 1;
#endif /* CONFIG_ALTIVEC */
+#ifndef CONFIG_SMP
+ preempt_disable();
+ if (last_task_used_math == current)
+ last_task_used_math = NULL;
+ if (last_task_used_altivec == current)
+ last_task_used_altivec = NULL;
+ preempt_enable();
+#endif
return 0;
}
schedule();
if (do_signal32(&saveset, regs))
/*
- * If a signal handler needs to be called,
- * do_signal32() has set R3 to the signal number (the
- * first argument of the signal handler), so don't
- * overwrite that with EINTR !
- * In the other cases, do_signal32() doesn't touch
- * R3, so it's still set to -EINTR (see above).
+ * Returning 0 means we return to userspace via
+ * ret_from_except and thus restore all user
+ * registers from *regs. This is what we need
+ * to do when a signal has been delivered.
*/
return 0;
}
schedule();
if (do_signal32(&saveset, regs))
/*
- * If a signal handler needs to be called,
- * do_signal32() has set R3 to the signal number (the
- * first argument of the signal handler), so don't
- * overwrite that with EINTR !
- * In the other cases, do_signal32() doesn't touch
- * R3, so it's still set to -EINTR (see above).
+ * Returning 0 means we return to userspace via
+ * ret_from_except and thus restore all user
+ * registers from *regs. This is what we need
+ * to do when a signal has been delivered.
*/
return 0;
}
* Set up a signal frame for a "real-time" signal handler
* (one which gets siginfo).
*/
-static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
- siginfo_t *info, sigset_t *oldset,
- struct pt_regs * regs, unsigned long newsp)
+static int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
+ siginfo_t *info, sigset_t *oldset,
+ struct pt_regs * regs, unsigned long newsp)
{
struct rt_sigframe32 __user *rt_sf;
struct mcontext32 __user *frame;
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
- return;
+ return 1;
badframe:
#if DEBUG_SIG
regs, frame, newsp);
#endif
force_sigsegv(sig, current);
+ return 0;
}
static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs, int sig)
/*
* OK, we're invoking a handler
*/
-static void handle_signal32(unsigned long sig, struct k_sigaction *ka,
+static int handle_signal32(unsigned long sig, struct k_sigaction *ka,
siginfo_t *info, sigset_t *oldset,
struct pt_regs * regs, unsigned long newsp)
{
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
- return;
+ return 1;
badframe:
#if DEBUG_SIG
regs, frame, *newspp);
#endif
force_sigsegv(sig, current);
+ return 0;
}
/*
/* Whee! Actually deliver the signal. */
if (ka.sa.sa_flags & SA_SIGINFO)
- handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp);
+ ret = handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp);
else
- handle_signal32(signr, &ka, &info, oldset, regs, newsp);
+ ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp);
- if (!(ka.sa.sa_flags & SA_NODEFER)) {
+ if (ret && !(ka.sa.sa_flags & SA_NODEFER)) {
spin_lock_irq(¤t->sighand->siglock);
sigorsets(¤t->blocked, ¤t->blocked,
&ka.sa.sa_mask);
spin_unlock_irq(¤t->sighand->siglock);
}
- return 1;
+ return ret;
}