From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH 1/3] arch, arm32: add definition of paddr_bits Date: Sun, 02 Mar 2014 16:13:41 +0800 Message-ID: <5312E835.4080700@linaro.org> References: <1393721365-22458-1-git-send-email-avanzini.arianna@gmail.com> <1393721365-22458-2-git-send-email-avanzini.arianna@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1393721365-22458-2-git-send-email-avanzini.arianna@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: Arianna Avanzini , xen-devel@lists.xen.org Cc: paolo.valente@unimore.it, Ian Campbell , stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, Tim Deegan , julien.grall@citrix.com, etrudeau@broadcom.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org Hello Arianna, On 02/03/14 08:49, Arianna Avanzini wrote: > Currently, the paddr_bits variable, which keeps the machine word size, > is not defined for the arm32 architecture. This commits adds its > definition for arm32 in a new header in the architecture-specific > directory. > This change is instrumental to the implementation of the > XEN_DOMCTL_memory_mapping hypercall, added in the following > commit. paddr_bits doesn't keep the machine word size but the size of the physical address. On ARM, this value is fixed and defined as PADDR_BITS in xen/include/asm-arm/page.h. I don't think we need to introduce a variable for this purpose. x86 defines paddr_bits because the value can change on some processor. > diff --git a/xen/arch/arm/arm32/cpu.h b/xen/arch/arm/arm32/cpu.h > new file mode 100644 > index 0000000..1091051 > --- /dev/null > +++ b/xen/arch/arm/arm32/cpu.h > @@ -0,0 +1,7 @@ > +#ifndef __ARM_ARM32_CPU_H > +#define __ARM_ARM32_CPU_H > + > +/* ARM-v7 features LPAE (machine word size is 40 bit) */ > +unsigned int paddr_bits = 40; > + Global variable must not be defined in headers. If someone decides to include this header in 2 differents C files, the variable will be defined twice. Therefore the linker-step will fail. You should define it in a c-file. Regards, -- Julien Grall