From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSY1h-00033D-CM for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:42:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSY1c-0002xT-GZ for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:42:24 -0500 Received: from [199.232.76.173] (port=60168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSY1c-0002xK-6o for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:42:20 -0500 Received: from mail-px0-f189.google.com ([209.85.216.189]:45228) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSY1b-0003Gn-O6 for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:42:20 -0500 Received: by pxi27 with SMTP id 27so10974406pxi.4 for ; Wed, 06 Jan 2010 07:42:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20100105231918.6526.19467.stgit@skyserv> References: <20100105231558.6526.44483.stgit@skyserv> <20100105231918.6526.19467.stgit@skyserv> From: Blue Swirl Date: Wed, 6 Jan 2010 15:41:58 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 3/9] sparc64: use helper_wrpil to check pending irq on write Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Igor V. Kovalenko" Cc: qemu-devel@nongnu.org On Tue, Jan 5, 2010 at 11:19 PM, Igor V. Kovalenko wrote: > From: Igor V. Kovalenko > > Signed-off-by: Igor V. Kovalenko > --- > =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=A05 +---- > =C2=A03 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/target-sparc/helper.h b/target-sparc/helper.h > index 4002b9e..6f103e7 100644 > --- a/target-sparc/helper.h > +++ b/target-sparc/helper.h > @@ -5,6 +5,7 @@ DEF_HELPER_0(rett, void) > =C2=A0DEF_HELPER_1(wrpsr, void, tl) > =C2=A0DEF_HELPER_0(rdpsr, tl) > =C2=A0#else > +DEF_HELPER_1(wrpil, void, tl) > =C2=A0DEF_HELPER_1(wrpstate, void, tl) > =C2=A0DEF_HELPER_0(done, void) > =C2=A0DEF_HELPER_0(retry, void) > diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c > index 26092e5..a7da0e4 100644 > --- a/target-sparc/op_helper.c > +++ b/target-sparc/op_helper.c > @@ -3303,6 +3303,20 @@ void helper_wrpstate(target_ulong new_state) > =C2=A0 =C2=A0 change_pstate(new_state & 0xf3f); > =C2=A0} > > +void helper_wrpil(target_ulong new_pil) > +{ > + =C2=A0 =C2=A0DPRINTF_PSTATE("helper_wrpil old=3D%X new=3D%X\n", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 env->psr= pil, (uint32_t)new_pil); > + > + =C2=A0 =C2=A0env->psrpil =3D new_pil; > + > +#if !defined(CONFIG_USER_ONLY) > + =C2=A0 =C2=A0if (env->pstate & PS_IE) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_check_irqs(env); > + =C2=A0 =C2=A0} > +#endif > +} It's not possible to write to PIL in user mode, so the whole code inside the function should be surrounded by #if !defined(CONFIG_USER_ONLY)/#endif. Please use lowercase hex. I'm wondering about using target_ulong instead of uint32_t (type of env->psrpil). TL makes the generated code shorter, uint32_t would decrease TCG register pressure on 32 bit hosts. This is not performance critical, so either way should be OK.