From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v8 2/7] xen/arm: Stringify the register name in sysreg read write macros Date: Wed, 23 Jul 2014 18:20:48 +0100 Message-ID: <53CFEEF0.2020300@linaro.org> References: <1406122913-8303-1-git-send-email-vijay.kilari@gmail.com> <1406122913-8303-3-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406122913-8303-3-git-send-email-vijay.kilari@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com, manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org Hi Vijay, On 07/23/2014 02:41 PM, vijay.kilari@gmail.com wrote: > From: Vijaya Kumar K > > The register name parameter in {READ,WRITE}_SYSREG{32,64} > macros is replaced as register name in mrs and msr assembly > instruction. > > If this register name is macro indirection, the register > name is not replaced with designated macro. So replace the register > name with __stringify macro, which replaces register name > if it is macro > > Signed-off-by: Vijaya Kumar K Acked-by: Julien Grall Regards, > --- > xen/include/asm-arm/arm64/processor.h | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h > index 5bf0867..3a9c0cd 100644 > --- a/xen/include/asm-arm/arm64/processor.h > +++ b/xen/include/asm-arm/arm64/processor.h > @@ -1,6 +1,8 @@ > #ifndef __ASM_ARM_ARM64_PROCESSOR_H > #define __ASM_ARM_ARM64_PROCESSOR_H > > +#include > + > #ifndef __ASSEMBLY__ > > /* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */ > @@ -85,20 +87,20 @@ struct cpu_user_regs > > #define READ_SYSREG32(name) ({ \ > uint32_t _r; \ > - asm volatile("mrs %0, "#name : "=r" (_r)); \ > + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ > _r; }) > #define WRITE_SYSREG32(v, name) do { \ > uint32_t _r = v; \ > - asm volatile("msr "#name", %0" : : "r" (_r)); \ > + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ > } while (0) > > #define WRITE_SYSREG64(v, name) do { \ > uint64_t _r = v; \ > - asm volatile("msr "#name", %0" : : "r" (_r)); \ > + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ > } while (0) > #define READ_SYSREG64(name) ({ \ > uint64_t _r; \ > - asm volatile("mrs %0, "#name : "=r" (_r)); \ > + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ > _r; }) > > #define READ_SYSREG(name) READ_SYSREG64(name) > -- Julien Grall