diff options
author | Ryan S. Arnold <rsa@linux.vnet.ibm.com> | 2013-06-27 15:48:35 -0500 |
---|---|---|
committer | Ryan S. Arnold <rsa@linux.vnet.ibm.com> | 2013-06-27 15:48:35 -0500 |
commit | 0cfec279fbb3c25b9c37e35e303ad4cdab77ed81 (patch) | |
tree | bd6898ac31cecffe9ea408e08113eb6e648ad9a9 /elf | |
parent | fe114d206479a36369d732ea260e81a686fdbb0b (diff) | |
download | glibc-rsa/hwcap2_v5.zip glibc-rsa/hwcap2_v5.tar.gz glibc-rsa/hwcap2_v5.tar.bz2 |
Add GLRO(dl_hwcap2), conditional on per platform HWCAP2_AVAIL.rsa/hwcap2_v5
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-support.c | 10 | ||||
-rw-r--r-- | elf/dl-sysdep.c | 15 |
2 files changed, 23 insertions, 2 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c index b3ab956..94d35e9 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -31,6 +31,7 @@ #include <dl-cache.h> #include <dl-librecon.h> #include <dl-procinfo.h> +#include <dl-hwcap2.h> #include <unsecvars.h> #include <hp-timing.h> #include <stackinfo.h> @@ -131,6 +132,10 @@ const ElfW(Phdr) *_dl_phdr; size_t _dl_phnum; uint64_t _dl_hwcap __attribute__ ((nocommon)); +#if HWCAP2_AVAIL +uint64_t _dl_hwcap2 __attribute__ ((nocommon)); +#endif + /* This is not initialized to HWCAP_IMPORTANT, matching the definition of _dl_important_hwcaps, below, where no hwcap strings are ever used. This mask is still used to mediate the lookups in the cache @@ -214,6 +219,11 @@ _dl_aux_init (ElfW(auxv_t) *av) case AT_HWCAP: GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; break; +#if HWCAP2_AVAIL + case AT_HWCAP2: + GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val; + break; +#endif #ifdef NEED_DL_SYSINFO case AT_SYSINFO: GL(dl_sysinfo) = av->a_un.a_val; diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c index 52de23f..50d84a0 100644 --- a/elf/dl-sysdep.c +++ b/elf/dl-sysdep.c @@ -43,6 +43,7 @@ #include <dl-osinfo.h> #include <hp-timing.h> #include <tls.h> +#include <dl-hwcap2.h> extern char **_environ attribute_hidden; extern char _end[] attribute_hidden; @@ -156,6 +157,11 @@ _dl_sysdep_start (void **start_argptr, case AT_HWCAP: GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; break; +#if HWCAP2_AVAIL + case AT_HWCAP2: + GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val; + break; +#endif case AT_CLKTCK: GLRO(dl_clktck) = av->a_un.a_val; break; @@ -303,6 +309,7 @@ _dl_show_auxv (void) [AT_SYSINFO - 2] = { "SYSINFO: 0x", hex }, [AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex }, [AT_RANDOM - 2] = { "RANDOM: 0x", hex }, + [AT_HWCAP2 - 2] = { "HWCAP2: 0x", hex }, }; unsigned int idx = (unsigned int) (av->a_type - 2); @@ -314,10 +321,14 @@ _dl_show_auxv (void) assert (AT_NULL == 0); assert (AT_IGNORE == 1); +#if HWCAP2_AVAIL + if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2) +#else if (av->a_type == AT_HWCAP) +#endif { - /* This is handled special. */ - if (_dl_procinfo (av->a_un.a_val) == 0) + /* These are handled in a special way per platform. */ + if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0) continue; } |