From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PULL 16/63] PPC: Add asm helpers for BE 32bit load/store Date: Fri, 01 Aug 2014 20:19:21 +1000 Message-ID: <1406888361.4935.246.camel@pasglop> References: <1406884714-33099-1-git-send-email-agraf@suse.de> <1406884714-33099-17-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf Return-path: In-Reply-To: <1406884714-33099-17-git-send-email-agraf@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, 2014-08-01 at 11:17 +0200, Alexander Graf wrote: > >From assembly code we might not only have to explicitly BE access 64bit values, > but sometimes also 32bit ones. Add helpers that allow for easy use of lwzx/stwx > in their respective byte-reverse or native form. > > Signed-off-by: Alexander Graf Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/include/asm/asm-compat.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h > index 4b237aa..21be8ae 100644 > --- a/arch/powerpc/include/asm/asm-compat.h > +++ b/arch/powerpc/include/asm/asm-compat.h > @@ -34,10 +34,14 @@ > #define PPC_MIN_STKFRM 112 > > #ifdef __BIG_ENDIAN__ > +#define LWZX_BE stringify_in_c(lwzx) > #define LDX_BE stringify_in_c(ldx) > +#define STWX_BE stringify_in_c(stwx) > #define STDX_BE stringify_in_c(stdx) > #else > +#define LWZX_BE stringify_in_c(lwbrx) > #define LDX_BE stringify_in_c(ldbrx) > +#define STWX_BE stringify_in_c(stwbrx) > #define STDX_BE stringify_in_c(stdbrx) > #endif >