On 6 September 2015 at 00:57, Timothy E Baldwin <t.e.baldwi...@members.leeds.ac.uk> wrote: > Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk> > --- > > Works without signals, but my signal test case > crashes with or without my changes. > > linux-user/main.c | 14 +++++++++----- > linux-user/microblaze/syscall.h | 2 ++ > linux-user/signal.c | 2 +- > 3 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index d47e33f..3eacc9c 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -2911,14 +2911,14 @@ void cpu_loop(CPUMBState *env) > queue_signal(env, info.si_signo, &info); > } > break; > - case EXCP_INTERRUPT: > - /* just indicate that signals should be handled asap */ > - break; > + case EXCP_INTERRUPT: > + /* just indicate that signals should be handled asap */ > + break; > case EXCP_BREAK: > /* Return address is 4 bytes after the call. */ > env->regs[14] += 4; > env->sregs[SR_PC] = env->regs[14]; > - ret = do_syscall(env, > + ret = do_syscall(env, > env->regs[12], > env->regs[5], > env->regs[6], > @@ -2927,7 +2927,11 @@ void cpu_loop(CPUMBState *env) > env->regs[9], > env->regs[10], > 0, 0); > - env->regs[3] = ret; > + if (ret == -TARGET_ERESTARTSYS) { > + env->sregs[SR_PC] -= 4;
This isn't going to cleanly undo the changes to regs[14] and sregs[SR_PC] that we do on entry, so I think the restart isn't going to work right. > + } else if (ret != -TARGET_QEMU_ESIGRETURN) { > + env->regs[3] = ret; > + } > break; > case EXCP_HW_EXCP: > env->regs[17] = env->sregs[SR_PC] + 4; thanks -- PMM