On 22 November 2012 02:10, Feng Gao <gf91...@gmail.com> wrote: > From: gaofeng <gaofeng@gaofeng-K43SM.(none)>
This doesn't look like a valid From line... > When float exception raise, can save right pc. > > Signed-off-by: Feng Gao <gf91...@gmail.com> > --- > target-openrisc/exception.c | 35 ++++++++++++++++++++++++++++-- > target-openrisc/exception.h | 8 ++++++- > target-openrisc/fpu_helper.c | 48 > +++++++++++++++++++++++------------------- > target-openrisc/mmu_helper.c | 17 +++------------ > 4 files changed, 69 insertions(+), 39 deletions(-) > > diff --git a/target-openrisc/exception.c b/target-openrisc/exception.c > index 58e53c6..f37e32c 100644 > --- a/target-openrisc/exception.c > +++ b/target-openrisc/exception.c > @@ -20,8 +20,39 @@ > #include "cpu.h" > #include "exception.h" > > -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp) > +void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t exception) > { > - cpu->env.exception_index = excp; > + do_raise_exception_err(cpu, exception, 0); > +} > + > +void QEMU_NORETURN do_raise_exception_err(OpenRISCCPU *cpu, > + uint32_t exception, > + uintptr_t pc) > +{ > + TranslationBlock *tb; > +#if 1 > + if (exception < 0x100) > + qemu_log("%s: %d\n", __func__, exception); > +#endif Stray debug tracing? > + cpu->env.exception_index = exception; > + > + if (pc) { > + /* now we have a real cpu fault */ > + tb = tb_find_pc(pc); > + if (tb) { > + /* the PC is inside the translated code. It means that we have > + a virtual CPU fault */ > + cpu_restore_state(tb, &cpu->env, pc); > + } > + } > + > cpu_loop_exit(&cpu->env); > } > + > +void QEMU_NORETURN do_raise_exception(OpenRISCCPU *cpu, > + uint32_t exception, > + uintptr_t pc) > +{ > + do_raise_exception_err(cpu, exception, pc); > +} What's this wrapper for? -- PMM