From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ0j4-0007a2-CX for qemu-devel@nongnu.org; Fri, 27 May 2011 13:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQ0j3-00038Z-Hs for qemu-devel@nongnu.org; Fri, 27 May 2011 13:21:30 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:39245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ0j3-00038V-Fb for qemu-devel@nongnu.org; Fri, 27 May 2011 13:21:29 -0400 Received: by qwj8 with SMTP id 8so1164799qwj.4 for ; Fri, 27 May 2011 10:21:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Blue Swirl Date: Fri, 27 May 2011 20:21:07 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julien Grall Cc: qemu-devel@nongnu.org, Fabien Chouteau On Fri, May 27, 2011 at 7:25 PM, Julien Grall wrot= e: > Hello, > > Since the last patch, I have added a special helper for trap 0. It > will be use when the TA0_Shutdown feature is enabled. This patch looks OK now. > Signed-off-by: Grall Julien > --- > =C2=A0target-sparc/helper.h =C2=A0 =C2=A0| =C2=A0 =C2=A01 + > =C2=A0target-sparc/op_helper.c | =C2=A0 14 ++++++++++++++ > =C2=A0target-sparc/translate.c | =C2=A0 =C2=A06 ++---- > =C2=A03 files changed, 17 insertions(+), 4 deletions(-) > > diff --git a/target-sparc/helper.h b/target-sparc/helper.h > index 61ef03a..7f50c7a 100644 > --- a/target-sparc/helper.h > +++ b/target-sparc/helper.h > @@ -86,6 +86,7 @@ DEF_HELPER_0(fcmpeq_fcc3, void) > =C2=A0#endif > =C2=A0DEF_HELPER_1(raise_exception, void, int) > =C2=A0DEF_HELPER_1(trap_always, void, int) > +DEF_HELPER_1(trap_0, 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 8f9d579..266080d 100644 > --- a/target-sparc/op_helper.c > +++ b/target-sparc/op_helper.c > @@ -330,6 +330,19 @@ void HELPER(trap_always)(int tt) > =C2=A0 =C2=A0 do_interrupt(env); > =C2=A0} > > +void HELPER(trap_0)(int tt) > +{ > +#ifndef TARGET_SPARC64 > + =C2=A0 =C2=A0if (env->psret =3D=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0helper_shutdown(); > + =C2=A0 =C2=A0} else { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0helper_trap_always(tt); > + =C2=A0 =C2=A0} > +#else > + =C2=A0 =C2=A0helper_trap_always(tt); > +#endif > +} > + > =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 64035fc..13181ef 100644 > --- a/target-sparc/translate.c > +++ b/target-sparc/translate.c > @@ -2037,10 +2037,8 @@ 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 tcg= _gen_trunc_tl_i32(cpu_tmp32, cpu_dst); > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if = (rs2 =3D=3D 0 && > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) { > - > - =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_shutdown(); > - > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(dc->def->features & CPU_FEATURE_TA0_SHUTDOWN)) { > + =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_0(cpu_tmp32); > =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=A0 gen_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 } > -- > 1.7.4.4 > >