aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/dl-procinfo.h
diff options
context:
space:
mode:
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>2015-12-28 16:36:46 -0200
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2016-03-08 15:30:06 -0300
commit911569d02dec023d949d96aa7b0e828c91c06f55 (patch)
treee9f75c7614b9901eaa1352f9e4b48b92209c85c9 /sysdeps/powerpc/dl-procinfo.h
parent87da630b22f70355531a759099f7f4b9311fb39d (diff)
downloadglibc-911569d02dec023d949d96aa7b0e828c91c06f55.tar
glibc-911569d02dec023d949d96aa7b0e828c91c06f55.tar.gz
glibc-911569d02dec023d949d96aa7b0e828c91c06f55.tar.bz2
glibc-911569d02dec023d949d96aa7b0e828c91c06f55.zip
powerpc: Fix dl-procinfo HWCAP
HWCAP-related code should had been updated when the 32 bits of HWCAP were used. This patch updates the code in dl-procinfo.h to loop through all the 32 bits in HWCAP and updates _dl_powerpc_cap_flags accordingly.
Diffstat (limited to 'sysdeps/powerpc/dl-procinfo.h')
-rw-r--r--sysdeps/powerpc/dl-procinfo.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index bce3a49ac0..2187c5e190 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -22,9 +22,6 @@
#include <ldsodefs.h>
#include <sysdep.h> /* This defines the PPC_FEATURE[2]_* macros. */
-/* There are 28 bits used, but they are bits 4..31. */
-#define _DL_HWCAP_FIRST 4
-
/* The total number of available bits (including those prior to
_DL_HWCAP_FIRST). Some of these bits might not be used. */
#define _DL_HWCAP_COUNT 64
@@ -68,7 +65,7 @@ static inline const char *
__attribute__ ((unused))
_dl_hwcap_string (int idx)
{
- return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
+ return GLRO(dl_powerpc_cap_flags)[idx];
}
static inline const char *
@@ -82,7 +79,7 @@ static inline int
__attribute__ ((unused))
_dl_string_hwcap (const char *str)
{
- for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
+ for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
if (strcmp (str, _dl_hwcap_string (i)) == 0)
return i;
return -1;
@@ -180,7 +177,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
case AT_HWCAP:
_dl_printf ("AT_HWCAP: ");
- for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
+ for (int i = 0; i <= _DL_HWCAP_LAST; ++i)
if (word & (1 << i))
_dl_printf (" %s", _dl_hwcap_string (i));
break;