Message ID | 20170622091713.27679-1-petri.savolainen@linaro.org |
---|---|
State | Accepted |
Commit | 09a7800c4c4a093fb962e362952f9cf562d2fc98 |
Headers | show |
On Thu, Jun 22, 2017 at 4:17 AM, Petri Savolainen <petri.savolainen@linaro.org> wrote: > Use __aarch64__ instead of __ARM_ARCH, since it's backwards > compatible between GCC versions. > > Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> > --- > platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c > index 91d439d9..28ee508b 100644 > --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c > +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c > @@ -68,7 +68,7 @@ int cpu_has_global_time(void) > > uint64_t cpu_global_time(void) > { > -#if __ARM_ARCH == 8 > +#ifdef __aarch64__ > uint64_t cntvct; > > /* > @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) > > uint64_t cpu_global_time_freq(void) > { > -#if __ARM_ARCH == 8 > +#ifdef __aarch64__ > uint64_t cntfrq; > > __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); > -- > 2.13.0 >
just merged it with Brians review. Tested ifdefs yesterday. Maxim. On 22 June 2017 at 15:49, Bill Fischofer <bill.fischofer@linaro.org> wrote: > On Thu, Jun 22, 2017 at 4:17 AM, Petri Savolainen > <petri.savolainen@linaro.org> wrote: > > Use __aarch64__ instead of __ARM_ARCH, since it's backwards > > compatible between GCC versions. > > > > Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 > > > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > > Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> > > > --- > > platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c > b/platform/linux-generic/arch/arm/odp_cpu_arch.c > > index 91d439d9..28ee508b 100644 > > --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c > > +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c > > @@ -68,7 +68,7 @@ int cpu_has_global_time(void) > > > > uint64_t cpu_global_time(void) > > { > > -#if __ARM_ARCH == 8 > > +#ifdef __aarch64__ > > uint64_t cntvct; > > > > /* > > @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) > > > > uint64_t cpu_global_time_freq(void) > > { > > -#if __ARM_ARCH == 8 > > +#ifdef __aarch64__ > > uint64_t cntfrq; > > > > __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); > > -- > > 2.13.0 > > >
diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c index 91d439d9..28ee508b 100644 --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c @@ -68,7 +68,7 @@ int cpu_has_global_time(void) uint64_t cpu_global_time(void) { -#if __ARM_ARCH == 8 +#ifdef __aarch64__ uint64_t cntvct; /* @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) uint64_t cpu_global_time_freq(void) { -#if __ARM_ARCH == 8 +#ifdef __aarch64__ uint64_t cntfrq; __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : );
Use __aarch64__ instead of __ARM_ARCH, since it's backwards compatible between GCC versions. Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0