mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-03 12:11:17 +03:00
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.
This commit is contained in:
committed by
Tulio Magno Quites Machado Filho
parent
87da630b22
commit
911569d02d
@@ -1,3 +1,10 @@
|
|||||||
|
2016-03-08 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Updated
|
||||||
|
to reflect the entire 32-bit HWCAP.
|
||||||
|
* sysdeps/powerpc/dl-procinfo.h: Code cleanup.
|
||||||
|
(_DL_HWCAP_FIRST): Removed. Replaced by 0 accordingly.
|
||||||
|
|
||||||
2016-03-08 H.J. Lu <hongjiu.lu@intel.com>
|
2016-03-08 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
[BZ #19783]
|
[BZ #19783]
|
||||||
|
|||||||
@@ -45,11 +45,12 @@
|
|||||||
#if !defined PROCINFO_DECL && defined SHARED
|
#if !defined PROCINFO_DECL && defined SHARED
|
||||||
._dl_powerpc_cap_flags
|
._dl_powerpc_cap_flags
|
||||||
#else
|
#else
|
||||||
PROCINFO_CLASS const char _dl_powerpc_cap_flags[60][10]
|
PROCINFO_CLASS const char _dl_powerpc_cap_flags[64][10]
|
||||||
#endif
|
#endif
|
||||||
#ifndef PROCINFO_DECL
|
#ifndef PROCINFO_DECL
|
||||||
= {
|
= {
|
||||||
"ppcle", "true_le", "archpmu", "vsx",
|
"ppcle", "true_le", "", "",
|
||||||
|
"", "", "archpmu", "vsx",
|
||||||
"arch_2_06", "power6x", "dfp", "pa6t",
|
"arch_2_06", "power6x", "dfp", "pa6t",
|
||||||
"arch_2_05", "ic_snoop", "smt", "booke",
|
"arch_2_05", "ic_snoop", "smt", "booke",
|
||||||
"cellbe", "power5+", "power5", "power4",
|
"cellbe", "power5+", "power5", "power4",
|
||||||
|
|||||||
@@ -22,9 +22,6 @@
|
|||||||
#include <ldsodefs.h>
|
#include <ldsodefs.h>
|
||||||
#include <sysdep.h> /* This defines the PPC_FEATURE[2]_* macros. */
|
#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
|
/* The total number of available bits (including those prior to
|
||||||
_DL_HWCAP_FIRST). Some of these bits might not be used. */
|
_DL_HWCAP_FIRST). Some of these bits might not be used. */
|
||||||
#define _DL_HWCAP_COUNT 64
|
#define _DL_HWCAP_COUNT 64
|
||||||
@@ -68,7 +65,7 @@ static inline const char *
|
|||||||
__attribute__ ((unused))
|
__attribute__ ((unused))
|
||||||
_dl_hwcap_string (int idx)
|
_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 *
|
static inline const char *
|
||||||
@@ -82,7 +79,7 @@ static inline int
|
|||||||
__attribute__ ((unused))
|
__attribute__ ((unused))
|
||||||
_dl_string_hwcap (const char *str)
|
_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)
|
if (strcmp (str, _dl_hwcap_string (i)) == 0)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -180,7 +177,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
|
|||||||
case AT_HWCAP:
|
case AT_HWCAP:
|
||||||
_dl_printf ("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))
|
if (word & (1 << i))
|
||||||
_dl_printf (" %s", _dl_hwcap_string (i));
|
_dl_printf (" %s", _dl_hwcap_string (i));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user