]> 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, 28 Jun 2013 21:50:48 +0000 (16:50 -0500)
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 f3da5170473de6d7e407a78eb27d96c6705bc389..1ee4457f2b18df819c36a44138af75987361f15a 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-28  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Shift by page_shift
index 76752f33f37a73e8b40a131d6cac5a91b3e8183c..5a082feb7a5c2f0c2b51fa8cd443c7738f522fc4 100644 (file)
@@ -165,6 +165,7 @@ ElfW(auxv_t) *_dl_auxv;
 const 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
@@ -249,6 +250,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 52de23f44b1bd37938cbb078f23eaa000a591892..08c74ef83bcb8dcea759fe4234ded4785b0ff67d 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;
@@ -303,6 +306,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 +318,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 4321e3718a8492214ebd9cfa2cfc359b815b293b..e0317fd6f9a089d8abbf9d767d9f07d4c488ae38 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 59e78d1d3bee8bdb95b10dd3660f9b1591ee4ea7..1ccae37e937cee38d5ffe9a4bac8f0d70a7df460 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-06-24  Richard Henderson  <rth@redhat.com>
 
        [BZ #15666]
index 2c07021cdf94186b44b4719018c91cb081ce50ff..6cc665c99ccd90ff93f57e4132c5262876960bfb 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-06-18  Roland McGrath  <roland@hack.frob.com>
 
        * sysdeps/arm/arm-mcount.S: Comment typo fix.
index 00542f59e2fd3738d80ff8defd9dc9168189b48e..1f69593a2dfb81815958a3ed4e63577f5366b9bb 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-06-27  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/mips/dl-static.c: Do not include
index 523d9667613b156bd2901c9f1fa82d9a80f32923..0344dbc968f294dcce382519e8588fd9c20e60d3 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 5cc9a44446eb12f0eb504e13f2b16674fb450eb5..e96550c402f5955ec6f2aa9847c11cc2b84e9854 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 161e86c796462cce4cc592c3b8039bbf65eb2bfb..251653ae1662f4b13915aff6b8441dc9d1628546 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 90c87d942a26975dd390a806cae14db21cfa6f94..a184a5918a34fc741b38b62df0d8af462cc997dd 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 cb172042597b2f0f9890daeecba44dca05b39c87..e7b0516aaf5e3dc9d374c5f0c453c9f93cdd8712 100644 (file)
@@ -554,6 +554,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 883fa7f0abc8ff6f285de2a2220e3233379cb9f5..233a3257e3a93d493e29b19ad9f53f131a9e3e3c 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 1c978ba62dbbe3049d15f7a941ca96f2d85d94e5..9531a2acc71a2ef53a0b58a541ffd3fd7f22c968 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 717f6f9a50807c612e58201a037155af14f3b9bb..45e27f1023d1e9088ea225436a669ed6f411eba1 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 a18b099586f8d9fdf615f17fe11f3adaf9126f89..71b279acdd1dc6b28d0c321bcdd632c37b23507e 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 a82f8f5b8d45c8d2e17de86cad5c1e5c796c270d..10f1c00b7b44e601f58a19a1f128b9bdc24b5bad 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 5ca4b76ca72527cf57412b8acdf8fac7f1e31840..331230443a0037dbb3bd900a4cdba15ee71e7cfb 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)