Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVRU8-0005Pc-Ej for qemu-devel@nongnu.org; Thu, 14 Jan 2010 10:19:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVRU2-0005JH-EY for qemu-devel@nongnu.org; Thu, 14 Jan 2010 10:19:43 -0500 Received: from [199.232.76.173] (port=39939 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVRU2-0005J1-6C for qemu-devel@nongnu.org; Thu, 14 Jan 2010 10:19:38 -0500 Received: from cantor.suse.de ([195.135.220.2]:42613 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NVRU1-0004o6-Jc for qemu-devel@nongnu.org; Thu, 14 Jan 2010 10:19:37 -0500 Subject: Re: [Qemu-devel] [PATCH] PPC: Add wrapper for target long DCR operations Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20100114151351.GC16630@volta.aurel32.net> Date: Thu, 14 Jan 2010 16:19:31 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <1095D71B-8F96-4270-A4AC-AC3C28BE055C@suse.de> References: <1262360466-25417-1-git-send-email-agraf@suse.de> <20100114151351.GC16630@volta.aurel32.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 14.01.2010, at 16:13, Aurelien Jarno wrote: > On Fri, Jan 01, 2010 at 04:41:06PM +0100, Alexander Graf wrote: >> The recent transition to always have the DCR helper functions take 32 = bit >> values broke the PPC64 target, as tlong became 64 bits there. >>=20 >> This patch moves all translate.c callers to a _tl function that = simply >> calls the uint32_t functions. That way we don't need to mess with TCG >> trying to pass registers as uint32_t variables to functions. >>=20 >> Fixes PPC64 build with --enable-debug-tcg >>=20 >> Signed-off-by: Alexander Graf >> Reported-by: Stefan Weil >> --- >> target-ppc/cpu.h | 2 ++ >> target-ppc/helper.h | 4 ++-- >> target-ppc/op_helper.c | 10 ++++++++++ >> target-ppc/translate.c | 12 ++++++------ >> 4 files changed, 20 insertions(+), 8 deletions(-) >>=20 >> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h >> index d15bba1..60a8b68 100644 >> --- a/target-ppc/cpu.h >> +++ b/target-ppc/cpu.h >> @@ -733,6 +733,8 @@ void ppc_store_slb (CPUPPCState *env, = target_ulong rb, target_ulong rs); >> void ppc_store_sr (CPUPPCState *env, int srnum, target_ulong value); >> #endif /* !defined(CONFIG_USER_ONLY) */ >> void ppc_store_msr (CPUPPCState *env, target_ulong value); >> +void helper_store_dcr (uint32_t dcrn, uint32_t val); >> +uint32_t helper_load_dcr (uint32_t dcrn); >>=20 >> void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char = *fmt, ...)); >>=20 >> diff --git a/target-ppc/helper.h b/target-ppc/helper.h >> index 40d4ced..86f0af7 100644 >> --- a/target-ppc/helper.h >> +++ b/target-ppc/helper.h >> @@ -359,8 +359,8 @@ DEF_HELPER_2(divo, tl, tl, tl) >> DEF_HELPER_2(divs, tl, tl, tl) >> DEF_HELPER_2(divso, tl, tl, tl) >>=20 >> -DEF_HELPER_1(load_dcr, i32, i32); >> -DEF_HELPER_2(store_dcr, void, i32, i32) >> +DEF_HELPER_1(load_dcr_tl, tl, tl); >> +DEF_HELPER_2(store_dcr_tl, void, tl, tl) >>=20 >> DEF_HELPER_1(load_dump_spr, void, i32) >> DEF_HELPER_1(store_dump_spr, void, i32) >> diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c >> index cea27f2..6c375d3 100644 >> --- a/target-ppc/op_helper.c >> +++ b/target-ppc/op_helper.c >> @@ -1844,6 +1844,11 @@ uint32_t helper_load_dcr (uint32_t dcrn) >> return val; >> } >>=20 >> +target_ulong helper_load_dcr_tl (target_ulong dcrn) >> +{ >> + return (uint32_t)helper_load_dcr((uint32_t)dcrn); >> +} >> + >> void helper_store_dcr (uint32_t dcrn, uint32_t val) >> { >> if (unlikely(env->dcr_env =3D=3D NULL)) { >> @@ -1857,6 +1862,11 @@ void helper_store_dcr (uint32_t dcrn, uint32_t = val) >> } >> } >>=20 >> +void helper_store_dcr_tl (target_ulong dcrn, target_ulong val) >> +{ >> + helper_store_dcr((uint32_t)dcrn, (uint32_t)val); >> +} >> + >=20 > I do wonder why we need to keep the old helper_load_dcr() and > helper_store_dcr() instead of modifying them directly. They doesn't = seems > to be used elsewhere. Last time I checked they were used in hw/*ppc*.c. Maybe mangled through = funny preprocessor or function callback logic. But maybe I'm wrong :). Alex=