From 3ab9b88e2ac91062b6d493fe32bd101a55006c6a Mon Sep 17 00:00:00 2001 From: Manjunath Matti Date: Tue, 19 Mar 2024 15:29:48 -0500 Subject: powerpc: Add HWCAP3/HWCAP4 data to TCB for Power Architecture. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a new feature for powerpc. In order to get faster access to the HWCAP3/HWCAP4 masks, similar to HWCAP/HWCAP2 (i.e. for implementing __builtin_cpu_supports() in GCC) without the overhead of reading them from the auxiliary vector, we now reserve space for them in the TCB. This is an ABI change for GLIBC 2.39. Suggested-by: Peter Bergner Reviewed-by: Peter Bergner --- elf/dl-diagnostics.c | 2 ++ elf/dl-support.c | 2 ++ elf/elf.h | 4 ++++ 3 files changed, 8 insertions(+) (limited to 'elf') diff --git a/elf/dl-diagnostics.c b/elf/dl-diagnostics.c index 7345ebc4e5..aaf67b87e8 100644 --- a/elf/dl-diagnostics.c +++ b/elf/dl-diagnostics.c @@ -235,6 +235,8 @@ _dl_print_diagnostics (char **environ) _dl_diagnostics_print_labeled_value ("dl_hwcap", GLRO (dl_hwcap)); _dl_diagnostics_print_labeled_value ("dl_hwcap_important", HWCAP_IMPORTANT); _dl_diagnostics_print_labeled_value ("dl_hwcap2", GLRO (dl_hwcap2)); + _dl_diagnostics_print_labeled_value ("dl_hwcap3", GLRO (dl_hwcap3)); + _dl_diagnostics_print_labeled_value ("dl_hwcap4", GLRO (dl_hwcap4)); _dl_diagnostics_print_labeled_string ("dl_hwcaps_subdirs", _dl_hwcaps_subdirs); _dl_diagnostics_print_labeled_value diff --git a/elf/dl-support.c b/elf/dl-support.c index 2f502c8b0d..451932dd03 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -158,6 +158,8 @@ const ElfW(Phdr) *_dl_phdr; size_t _dl_phnum; uint64_t _dl_hwcap; uint64_t _dl_hwcap2; +uint64_t _dl_hwcap3; +uint64_t _dl_hwcap4; enum dso_sort_algorithm _dl_dso_sort_algo; diff --git a/elf/elf.h b/elf/elf.h index f2206e5c06..55b2e87860 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -1234,6 +1234,10 @@ typedef struct #define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */ #define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */ +/* More machine-dependent hints about processor capabilities. */ +#define AT_HWCAP3 29 /* extension of AT_HWCAP. */ +#define AT_HWCAP4 30 /* extension of AT_HWCAP. */ + #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other -- cgit 1.4.1