]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add GLRO(dl_hwcap2) for new AT_HWCAP2 auxv_t a_type.
authorRyan S. Arnold <rsa@linux.vnet.ibm.com>
Fri, 28 Jun 2013 21:50:48 +0000 (16:50 -0500)
committerRyan S. Arnold <rsa@linux.vnet.ibm.com>
Fri, 26 Jul 2013 15:36:41 +0000 (10:36 -0500)
(cherry picked from commit 1ae8bfe07c1ab2444cc1d186321ff1431a1b9f96)

18 files changed:
ChangeLog
elf/dl-support.c
elf/dl-sysdep.c
misc/getauxval.c
ports/ChangeLog.alpha
ports/ChangeLog.arm
ports/ChangeLog.mips
ports/sysdeps/alpha/dl-procinfo.h
ports/sysdeps/mips/dl-procinfo.h
ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
sysdeps/generic/dl-procinfo.h
sysdeps/generic/ldsodefs.h
sysdeps/i386/dl-procinfo.h
sysdeps/powerpc/dl-procinfo.h
sysdeps/s390/dl-procinfo.h
sysdeps/sparc/dl-procinfo.h
sysdeps/unix/sysv/linux/i386/dl-procinfo.h
sysdeps/unix/sysv/linux/s390/dl-procinfo.h

index 7df6187e3cebf1d9c3b7f8034c521c6bcbc089dd..4addd6b70e8082a6f95cb4b13856f419e172bfb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2013-06-28  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
+       * elf/dl-support.c (_dl_hwcap2): Add a new hwcap field for more
+       hardware capabilities in support of AT_HWCAP2.
+       (_dl_aux_init): Read AT_HWCAP2 into GLRO(dl_hwcap2).
+       * elf/dl-sysdep.c (_dl_sysdep_start): Read AT_HWCAP2 into
+       GLRO(dl_hwcap2).
+       (_dl_show_auxv): Add support for calling _dl_procinfo to display
+       AT_HWCAP2.  If a platform doesn't chose to handle displaying AT_HWCAP2
+       explicitly the unknown a_type display mechanism is used.
+       * misc/getauxval.c (__getauxval): Return GLRO(dl_hwcap2) on AT_HWCAP2.
+       * sysdeps/generic/ldsodefs.h (rtld_global_ro): Add _dl_hwcap2 as a new
+       struct member.
+       * sysdeps/generic/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+       to macro prototype for AT_HWCAP2 support.
+       * sysdeps/i386/dl-procinfo.h: Likewise.
+       * sysdeps/s390/dl-procinfo.h: Likewise.
+       * sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Add TYPE parameter to
+       macro prototype for AT_HWCAP2 support.  Make WORD unsigned long int
+       rather than signed int.  Stub in handler for TYPE == AT_HWCAP2 to
+       return -1 for unknown a_type display fallback.
+       * sysdeps/sparc/dl-procinfo.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/dl-procinfo.h: Likewise.
+
 2013-06-26  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
 
        * elf/elf.h (AT_HWCAP2): Add a new a_type entry.
index 81e71720c670a13ed1dee468caf01eed7d5f6a87..05f53ee7e9b9ecd37cbb242cba5eaf6416c89d3e 100644 (file)
@@ -129,6 +129,7 @@ ElfW(auxv_t) *_dl_auxv;
 ElfW(Phdr) *_dl_phdr;
 size_t _dl_phnum;
 uint64_t _dl_hwcap __attribute__ ((nocommon));
+uint64_t _dl_hwcap2 __attribute__ ((nocommon));
 
 /* This is not initialized to HWCAP_IMPORTANT, matching the definition
    of _dl_important_hwcaps, below, where no hwcap strings are ever
@@ -212,6 +213,9 @@ _dl_aux_init (ElfW(auxv_t) *av)
       case AT_HWCAP:
        GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
        break;
+      case AT_HWCAP2:
+       GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val;
+       break;
 #ifdef NEED_DL_SYSINFO
       case AT_SYSINFO:
        GL(dl_sysinfo) = av->a_un.a_val;
index 65a90469c6bdd12cba03c5a21a283971db39868d..a0d1d044cea7fa026cf1859c5c40f11f03bf681a 100644 (file)
@@ -156,6 +156,9 @@ _dl_sysdep_start (void **start_argptr,
       case AT_HWCAP:
        GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
        break;
+      case AT_HWCAP2:
+       GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val;
+       break;
       case AT_CLKTCK:
        GLRO(dl_clktck) = av->a_un.a_val;
        break;
@@ -298,6 +301,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);
 
@@ -309,10 +313,10 @@ _dl_show_auxv (void)
       assert (AT_NULL == 0);
       assert (AT_IGNORE == 1);
 
-      if (av->a_type == AT_HWCAP)
+      if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2)
        {
-         /* 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;
        }
 
index bff456084e62d0d039360356dce14a08873cbb50..1c1882bb492c1f7f7d0645347f57e9bb6ad478a9 100644 (file)
@@ -26,6 +26,8 @@ __getauxval (unsigned long int type)
 
   if (type == AT_HWCAP)
     return GLRO(dl_hwcap);
+  else if (type == AT_HWCAP2)
+    return GLRO(dl_hwcap2);
 
   for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
     if (p->a_type == type)
index 39fd14d79081890e98fc363affe65f5ecb58ca06..054e4047e5e33a41718326ee5dfb44c55d80dd43 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-28  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
+       * sysdeps/alpha/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+       to macro prototype for AT_HWCAP2 support.
+
 2013-05-22  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
 
        * sysdeps/unix/sysv/linux/alpha/bits/siginfo.h (siginfo_t): Add
index 75a88265fb9064c47a97f8fa2ebbca22f3debcef..c1b8fc0a2d661ca91ac65841c3fc0874dff0b348 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-28  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
+       * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_dl_procinfo): Add
+       TYPE parameter to macro prototype for AT_HWCAP2 support.  Make WORD
+       unsigned long int rather than signed int.  Stub in handler for TYPE ==
+       AT_HWCAP2 to return -1 for unknown a_type display fallback.
+
 2013-02-08  Carlos O'Donell  <carlos@redhat.com>
 
        [BZ #15006]
index 5eca3b9612f8b4cce8f71afea915b11b16c1b48e..445548af8c98d6176ca53040c67726e5937e7837 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-28  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
+       * sysdeps/mips/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+       to macro prototype for AT_HWCAP2 support.
+
 2013-05-22  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
 
        * sysdeps/unix/sysv/linux/mips/bits/siginfo.h (siginfo_t): Add
index 3db0efb200c0a9f7f58c77b3a5982731becca1bd..c3b27b46b466f967d64375a28b203fc2cde6c84b 100644 (file)
@@ -51,7 +51,7 @@ _dl_string_platform (const char *str)
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""
index d42aea71416c496470a724dbb09297d82ff917e5..8c9f5c2347d78882ddf2a387bf73d75e02d059e0 100644 (file)
@@ -51,7 +51,7 @@ _dl_string_platform (const char *str)
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""
index bea7100e13f3f6fa0dcd3f0a72c53f6dd49140ba..c96297b0ee24364f2445e3326ad863fb54a349c2 100644 (file)
 
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
 
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
index c2bf9144571c047db35ccac381d39e63e21713f0..0345717333f29248f2086bdfd72f25da05b60839 100644 (file)
@@ -21,7 +21,7 @@
 #define _DL_PROCINFO_H 1
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""
index c667e34244f3a313fdd9d01dc66ec81053451d39..5635d72e791762c7fa67a05f0ac69c9558acd8d1 100644 (file)
@@ -548,6 +548,10 @@ struct rtld_global_ro
   EXTERN struct link_map *_dl_sysinfo_map;
 #endif
 
+  /* Mask for more hardware capabilities that are available on some
+     platforms.  */
+  EXTERN uint64_t _dl_hwcap2;
+
 #ifdef SHARED
   /* We add a function table to _rtld_global which is then used to
      call the function instead of going through the PLT.  The result
index 6ecaac2c735872e5d5b9572a4e3a67ad2916188c..38e902d8bded293dc74b1a6771943bdcd4078622 100644 (file)
@@ -61,7 +61,7 @@ enum
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 static inline const char *
 __attribute__ ((unused))
index 0939dcfeace1bd123613a0340ae6500478136704..7732ed2226210ccbcbc20b77e89115d05a12c01e 100644 (file)
@@ -159,8 +159,12 @@ _dl_string_platform (const char *str)
 #ifdef IS_IN_rtld
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
+
   _dl_printf ("AT_HWCAP:       ");
 
   for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
index 97dcf074f2f6dc1eeba8e286ac83ae029f4fcc61..26de0430d51b7d62cc4c67189c3732a5edff5c9e 100644 (file)
@@ -56,7 +56,7 @@ enum
                          | HWCAP_S390_EIMM | HWCAP_S390_DFP)
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 static inline const char *
 __attribute__ ((unused))
index 6ae87682880093b6af24263970010c7ebc9d8c5f..a05d4589ebd3714c3ca3e4d43fc329c701c7f0aa 100644 (file)
 
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
 
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
index 4c613575822c7ac4c2ed89698bb957a15fc7989d..23f4501bb69b68f89ce6c4a28a663b52cfe7ddcd 100644 (file)
 #undef _dl_procinfo
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   /* This table should match the information from arch/i386/kernel/setup.c
      in the kernel sources.  */
   int i;
 
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
index f36ba55155629cda33ea2d4008b6a38e08760c3d..759738e4549dd741c08b618d3355b549b9b034fa 100644 (file)
 #undef _dl_procinfo
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   /* This table should match the information from arch/s390/kernel/setup.c
      in the kernel sources.  */
   int i;
 
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)