From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk6kV-0002XU-O1 for qemu-devel@nongnu.org; Tue, 13 May 2014 03:03:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk6kP-0000us-4v for qemu-devel@nongnu.org; Tue, 13 May 2014 03:03:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42884 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk6kO-0000uo-VP for qemu-devel@nongnu.org; Tue, 13 May 2014 03:03:33 -0400 Message-ID: <5371C3C3.9000103@suse.de> Date: Tue, 13 May 2014 09:03:31 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1399565391-27833-1-git-send-email-pbonzini@redhat.com> <1399565391-27833-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1399565391-27833-10-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 09/11] target-arm: move arm_*_code to a separate file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, "Edgar E. Iglesias" , rth@twiddle.net Am 08.05.2014 18:09, schrieb Paolo Bonzini: > These will soon require cpu_ldst.h, so move them out of cpu.h. >=20 > Signed-off-by: Paolo Bonzini > --- > target-arm/arm_ldst.h | 47 ++++++++++++++++++++++++++++++++++++++= ++++++++ > target-arm/cpu.h | 22 ---------------------- > target-arm/helper.c | 1 + > target-arm/translate-a64.c | 1 + > target-arm/translate.c | 1 + > 5 files changed, 50 insertions(+), 22 deletions(-) > create mode 100644 target-arm/arm_ldst.h >=20 > diff --git a/target-arm/arm_ldst.h b/target-arm/arm_ldst.h > new file mode 100644 > index 0000000..42260ac > --- /dev/null > +++ b/target-arm/arm_ldst.h > @@ -0,0 +1,47 @@ > +/* > + * ARM load/store instructions for code (armeb-user support) > + * > + * Copyright (c) 2012 CodeSourcery, LLC > + * > + * This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2 of the License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with this library; if not, see . > + */ > + > +#ifndef ARM_LDST_H > +#define ARM_LDST_H > + > +#include "qemu/bswap.h" > + > +/* Load an instruction and return it in the standard little-endian ord= er */ > +static inline uint32_t arm_ldl_code(CPUARMState *env, target_ulong add= r, > + bool do_swap) > +{ > + uint32_t insn =3D cpu_ldl_code(env, addr); > + if (do_swap) { > + return bswap32(insn); > + } > + return insn; > +} > + > +/* Ditto, for a halfword (Thumb) instruction */ > +static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong ad= dr, > + bool do_swap) > +{ > + uint16_t insn =3D cpu_lduw_code(env, addr); > + if (do_swap) { > + return bswap16(insn); > + } > + return insn; > +} > + > +#endif [snip] Reviewed-by: Andreas F=E4rber I notice that these user-only functions/macros are taking CPUARMState but never use it today. Should I convert them to CPUState once I tackle linux-user, or can we just drop that unused argument? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg