CPUState *regs, unsigned long mask)
{
int err = 0;
+ int i;
#define COPY(x) err |= __put_user(regs->x, &sc->sc_##x)
COPY(gregs[0]); COPY(gregs[1]);
COPY(sr); COPY(pc);
#undef COPY
- /* todo: save FPU registers here */
+ for (i=0; i<16; i++) {
+ err |= __put_user(regs->fregs[i], &sc->sc_fpregs[i]);
+ }
+ err |= __put_user(regs->fpscr, &sc->sc_fpscr);
+ err |= __put_user(regs->fpul, &sc->sc_fpul);
/* non-iBCS2 extensions.. */
err |= __put_user(mask, &sc->oldmask);
return err;
}
-static int restore_sigcontext(CPUState *regs,
- struct target_sigcontext *sc)
+static int restore_sigcontext(CPUState *regs, struct target_sigcontext *sc,
+ target_ulong *r0_p)
{
unsigned int err = 0;
+ int i;
#define COPY(x) err |= __get_user(regs->x, &sc->sc_##x)
COPY(gregs[1]);
COPY(sr); COPY(pc);
#undef COPY
- /* todo: restore FPU registers here */
+ for (i=0; i<16; i++) {
+ err |= __get_user(regs->fregs[i], &sc->sc_fpregs[i]);
+ }
+ err |= __get_user(regs->fpscr, &sc->sc_fpscr);
+ err |= __get_user(regs->fpul, &sc->sc_fpul);
regs->tra = -1; /* disable syscall checks */
+ err |= __get_user(*r0_p, &sc->sc_gregs[0]);
return err;
}
abi_ulong frame_addr;
sigset_t blocked;
target_sigset_t target_set;
+ target_ulong r0;
int i;
int err = 0;
target_to_host_sigset_internal(&blocked, &target_set);
sigprocmask(SIG_SETMASK, &blocked, NULL);
- if (restore_sigcontext(regs, &frame->sc))
+ if (restore_sigcontext(regs, &frame->sc, &r0))
goto badframe;
unlock_user_struct(frame, frame_addr, 0);
- return regs->gregs[0];
+ return r0;
badframe:
unlock_user_struct(frame, frame_addr, 0);
struct target_rt_sigframe *frame;
abi_ulong frame_addr;
sigset_t blocked;
+ target_ulong r0;
#if defined(DEBUG_SIGNAL)
fprintf(stderr, "do_rt_sigreturn\n");
target_to_host_sigset(&blocked, &frame->uc.uc_sigmask);
sigprocmask(SIG_SETMASK, &blocked, NULL);
- if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
+ if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
goto badframe;
if (do_sigaltstack(frame_addr +
goto badframe;
unlock_user_struct(frame, frame_addr, 0);
- return regs->gregs[0];
+ return r0;
badframe:
unlock_user_struct(frame, frame_addr, 0);