about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-hwcap2.h25
-rw-r--r--sysdeps/generic/dl-procinfo.h2
-rw-r--r--sysdeps/generic/ldsodefs.h9
-rw-r--r--sysdeps/i386/dl-procinfo.h2
-rw-r--r--sysdeps/powerpc/dl-procinfo.h6
-rw-r--r--sysdeps/s390/dl-procinfo.h2
-rw-r--r--sysdeps/sparc/dl-procinfo.h6
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-procinfo.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/dl-procinfo.h6
9 files changed, 57 insertions, 7 deletions
diff --git a/sysdeps/generic/dl-hwcap2.h b/sysdeps/generic/dl-hwcap2.h
new file mode 100644
index 0000000000..cd6fdf9b59
--- /dev/null
+++ b/sysdeps/generic/dl-hwcap2.h
@@ -0,0 +1,25 @@
+/* HWCAP2 Availability Test
+   Copyright (C) 1998-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _HWCAP2_H
+#define _HWCAP2_H	1
+
+/* Default to unavailable.  */
+#define HWCAP2_AVAIL		(0)
+
+#endif	/* dl-hwcap2.h */
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
index 90c87d942a..a184a5918a 100644
--- a/sysdeps/generic/dl-procinfo.h
+++ b/sysdeps/generic/dl-procinfo.h
@@ -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) ""
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index cb17204259..edb6efdfe4 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -408,6 +408,7 @@ struct rtld_global
     size_t count;
     void *list[50];
   } *_dl_scope_free_list;
+
 #ifdef SHARED
 };
 # define __rtld_global_attribute__
@@ -554,6 +555,14 @@ struct rtld_global_ro
   EXTERN struct link_map *_dl_sysinfo_map;
 #endif
 
+#include <dl-hwcap2.h>
+
+#if HWCAP2_AVAIL
+  /* Mask for more hardware capabilities that are available on some
+     platforms.  */
+  EXTERN uint64_t _dl_hwcap2;
+#endif
+
 #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
diff --git a/sysdeps/i386/dl-procinfo.h b/sysdeps/i386/dl-procinfo.h
index 883fa7f0ab..233a3257e3 100644
--- a/sysdeps/i386/dl-procinfo.h
+++ b/sysdeps/i386/dl-procinfo.h
@@ -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))
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 1c978ba62d..73cd2799dd 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -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)
 {
+  /* Handle in a more sophisticated manner if HWCAP2 is supported.  */
+  if (type == AT_HWCAP2)
+    return 0;
+
   _dl_printf ("AT_HWCAP:       ");
 
   for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
index 717f6f9a50..45e27f1023 100644
--- a/sysdeps/s390/dl-procinfo.h
+++ b/sysdeps/s390/dl-procinfo.h
@@ -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))
diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
index a18b099586..35065c4371 100644
--- a/sysdeps/sparc/dl-procinfo.h
+++ b/sysdeps/sparc/dl-procinfo.h
@@ -27,10 +27,14 @@
 
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
 
+  /* Handle in a more sophisticated manner if HWCAP2 is supported.  */
+  if (type == AT_HWCAP2)
+    return 0;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
diff --git a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
index a82f8f5b8d..17d87aba11 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
@@ -24,12 +24,16 @@
 #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;
 
+  /* Handle in a more sophisticated manner if HWCAP2 is supported.  */
+  if (type == AT_HWCAP2)
+    return 0;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
diff --git a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
index 5ca4b76ca7..f4a36e0b60 100644
--- a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
@@ -24,12 +24,16 @@
 #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;
 
+  /* Handle in a more sophisticated manner if HWCAP2 is supported.  */
+  if (type == AT_HWCAP2)
+    return 0;
+
   _dl_printf ("AT_HWCAP:   ");
 
   for (i = 0; i < _DL_HWCAP_COUNT; ++i)