From afce1991f6f61514172696ec3edf93331cb0e04f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 11 Jan 2018 17:21:46 +0000 Subject: [PATCH] aarch64: make HWCAP updates less error prone Remove unused _DL_HWCAP_LAST definition and move _DL_HWCAP_COUNT where it is needed (dl-procinfo.h always includes dl-procinfo.c). * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (_DL_HWCAP_LAST): Remove. (_DL_HWCAP_COUNT): Move to ... * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT): ... here. --- ChangeLog | 8 ++++++++ sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c | 5 ++++- sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h | 6 ------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26914f7d76..d9d2a0fff9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-01-16 Szabolcs Nagy + + * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h + (_DL_HWCAP_LAST): Remove. + (_DL_HWCAP_COUNT): Move to ... + * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c + (_DL_HWCAP_COUNT): ... here. + 2018-01-16 Florian Weimer * nptl/Makefile (CFLAGS-tst-minstack-throw.o): Compile in C++11 diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c index 67d7fd6f35..2da8d7b910 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c +++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c @@ -56,10 +56,13 @@ PROCINFO_CLASS struct cpu_features _dl_aarch64_cpu_features # endif #endif +/* Number of HWCAP bits set. */ +#define _DL_HWCAP_COUNT 16 + #if !defined PROCINFO_DECL && defined SHARED ._dl_aarch64_cap_flags #else -PROCINFO_CLASS const char _dl_aarch64_cap_flags[16][10] +PROCINFO_CLASS const char _dl_aarch64_cap_flags[_DL_HWCAP_COUNT][10] #endif #ifndef PROCINFO_DECL /* Matches the names in arch/arm64/kernel/cpuinfo.c of Linux. */ diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h index cf683f5b29..6887713149 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h @@ -27,12 +27,6 @@ /* We cannot provide a general printing function. */ #define _dl_procinfo(type, word) -1 -/* Number of HWCAP bits set. */ -#define _DL_HWCAP_COUNT 16 - -/* Offset of the last bit allocated in HWCAP. */ -#define _DL_HWCAP_LAST 15 - /* HWCAP_CPUID should be available by default to influence IFUNC as well as library search. */ #define HWCAP_IMPORTANT HWCAP_CPUID -- 2.11.4.GIT