On Fri, Oct 28, 2016 at 2:33 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 28 October 2016 at 08:00, Vijay Kilari <vijay.kil...@gmail.com> wrote: >> On Thu, Oct 27, 2016 at 9:33 PM, Peter Maydell <peter.mayd...@linaro.org> >> wrote: >>> On 25 October 2016 at 13:12, <vijay.kil...@gmail.com> wrote: >>>> From: Vijaya Kumar K <vijaya.ku...@cavium.com> >>>> >>>> Add helper API to read MIDR_EL1 registers to fetch >>>> cpu identification information. This helps in >>>> adding errata's and architecture specific features. >>>> >>>> This is implemented only for arm architecture. >>>> >>>> Signed-off-by: Vijaya Kumar K <vijaya.ku...@cavium.com> > >>>> diff --git a/util/Makefile.objs b/util/Makefile.objs >>>> index 36c7dcc..d14a455 100644 >>>> --- a/util/Makefile.objs >>>> +++ b/util/Makefile.objs >>>> @@ -37,3 +37,4 @@ util-obj-y += log.o >>>> util-obj-y += qdist.o >>>> util-obj-y += qht.o >>>> util-obj-y += range.o >>>> +util-obj-y += aarch64-cpuid.o > >>> >>>> +#include "qemu/cutils.h" >>>> +#include "qemu/aarch64-cpuid.h" >>>> + >>>> +#if defined(__aarch64__) >>>> +static uint64_t qemu_read_aarch64_midr_el1(void) >>>> +{ >>>> +#ifdef CONFIG_LINUX >>> >>> When will CONFIG_LINUX not be defined but __aarch64__ is? >> The contents of this file is compiled only for aarch64 > > Your makefile change compiles it for everything. > >> and hence >> all the contents are under this __aarch64__. >> Also the code is only for linux, have added CONFIG_LINUX. > > ...and you haven't answered the question: in what > circumstances could __aarch64__ be defined but > CONFIG_LINUX is not, ie why is there any point in > checking both defines?
Ok. You mean __aarch64__ and __linux__ both are defined by gcc. we can rely on __aarch64__ define here?. AFAIK, the caller of this function bufferiszero.c is compiled for everything, I case of bufferiszero.c is compiled for other than linux for aarch64, compilation might fail. In such case, the header file needs to have dummy/empty functions.