From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ0nr-0003ll-Fw for qemu-devel@nongnu.org; Fri, 27 May 2011 13:26:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQ0nq-0003qD-Km for qemu-devel@nongnu.org; Fri, 27 May 2011 13:26:27 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:45643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ0nq-0003q8-Hh for qemu-devel@nongnu.org; Fri, 27 May 2011 13:26:26 -0400 Received: by qwj8 with SMTP id 8so1166999qwj.4 for ; Fri, 27 May 2011 10:26:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Blue Swirl Date: Fri, 27 May 2011 20:26:06 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2][SPARC] Improve sparc handling of ta List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julien Grall Cc: qemu-devel@nongnu.org, Fabien Chouteau On Tue, May 17, 2011 at 6:32 PM, Julien Grall wrot= e: > Improve sparc handling of ta > > Signed-off-by: Julien Grall > --- > =C2=A0target-sparc/helper.h =C2=A0 =C2=A0| =C2=A0 =C2=A01 + > =C2=A0target-sparc/op_helper.c | =C2=A0 =C2=A06 ++++++ > =C2=A0target-sparc/translate.c | =C2=A0 =C2=A07 ++++--- > =C2=A03 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/target-sparc/helper.h b/target-sparc/helper.h > index 12e8557..61ef03a 100644 > --- a/target-sparc/helper.h > +++ b/target-sparc/helper.h > @@ -85,6 +85,7 @@ DEF_HELPER_0(fcmpeq_fcc2, void) > =C2=A0DEF_HELPER_0(fcmpeq_fcc3, void) > =C2=A0#endif > =C2=A0DEF_HELPER_1(raise_exception, void, int) > +DEF_HELPER_1(trap_always, void, int) > =C2=A0DEF_HELPER_0(shutdown, void) > =C2=A0#define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void) > =C2=A0#define F_HELPER_DQ_0_0(name) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 \ > diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c > index ffffb8c..a6fabad 100644 > --- a/target-sparc/op_helper.c > +++ b/target-sparc/op_helper.c > @@ -324,6 +324,12 @@ void HELPER(raise_exception)(int tt) > =C2=A0 =C2=A0 raise_exception(tt); > =C2=A0} > > +void HELPER(trap_always)(int tt) > +{ > + =C2=A0 =C2=A0env->exception_index =3D tt; > + =C2=A0 =C2=A0do_interrupt(env); Sorry, I didn't catch this earlier. This should be cpu_loop_exit() and then the function becomes equal to raise_exception(). > +} > + > =C2=A0void helper_shutdown(void) > =C2=A0{ > =C2=A0#if !defined(CONFIG_USER_ONLY) > diff --git a/target-sparc/translate.c b/target-sparc/translate.c > index 3c958b2..b30003b 100644 > --- a/target-sparc/translate.c > +++ b/target-sparc/translate.c > @@ -1982,7 +1982,7 @@ static void disas_sparc_insn(DisasContext * dc) > =C2=A0 =C2=A0 case 2: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 /* FPU & Logical Operations */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int xop =3D GET_FIELD(= insn, 7, 12); > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (xop =3D=3D 0x3a) { =C2=A0/= * generate trap */ > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (xop =3D=3D 0x3a) { =C2=A0/= * ta, tcc: generate trap */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int cond; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cpu_src1 =3D get_= src1(insn, cpu_src1); > @@ -2015,7 +2015,7 @@ static void disas_sparc_insn(DisasContext * dc) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 gen_helper_shutdown(); > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } e= lse { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0gen_helper_raise_exception(cpu_tmp32); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0gen_helper_trap_always(cpu_tmp32); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (cond != =3D 0) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TCG= v r_cond =3D tcg_temp_new(); > @@ -2049,8 +2049,9 @@ static void disas_sparc_insn(DisasContext * dc) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gen= _set_label(l1); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tcg= _temp_free(r_cond); > + > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ge= n_op_next_insn(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gen_op_next_insn= (); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tcg_gen_exit_tb(0= ); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dc->is_br =3D 1; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto jmp_insn; > -- > 1.7.4.4 > >