Received: from eggs.gnu.org ([208.118.235.92]:38829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbbjF-0004af-B7 for qemu-devel@nongnu.org; Thu, 22 Nov 2012 13:42:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbbjE-0006YF-3I for qemu-devel@nongnu.org; Thu, 22 Nov 2012 13:42:25 -0500 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:39380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbbjD-0006Xm-AN for qemu-devel@nongnu.org; Thu, 22 Nov 2012 13:42:24 -0500 Date: Fri, 23 Nov 2012 02:42:13 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20121122184213.GA86870@cs.nctu.edu.tw> References: <1353550204-6510-1-git-send-email-gf91597@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1353550204-6510-1-git-send-email-gf91597@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-or32: Improve float exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Feng Gao Cc: "gaofeng (none)" , qemu-devel@nongnu.org > -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp) > +void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t exceptio= n) > { > - cpu->env.exception_index =3D 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 > + cpu->env.exception_index =3D exception; > + > + if (pc) { > + /* now we have a real cpu fault */ > + tb =3D 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); > +} I don't see any difference between do_raise_exception_err and do_raise_exception here. MIPS do have those functions, but function do_raise_exception_err has one more parameter for error code. Please see target-mips/op_helper.c. If you don't need error code, there just one function would be sufficient, I think. > diff --git a/target-openrisc/exception.h b/target-openrisc/exception.h > index 4b64430..1f0cd90 100644 > --- a/target-openrisc/exception.h > +++ b/target-openrisc/exception.h > @@ -23,6 +23,12 @@ > #include "cpu.h" > #include "qemu-common.h" > =20 > -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp); > +void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t exceptio= n); > =20 > +void QEMU_NORETURN do_raise_exception_err(OpenRISCCPU *cpu, > + uint32_t exception, > + uintptr_t pc); > +void QEMU_NORETURN do_raise_exception(OpenRISCCPU *cpu, > + uint32_t exception, > + uintptr_t pc); Ditto. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj