diff options
Diffstat (limited to 'sysdeps/powerpc/dl-procinfo.h')
-rw-r--r-- | sysdeps/powerpc/dl-procinfo.h | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h index bce3a49ac0..3803379ab2 100644 --- a/sysdeps/powerpc/dl-procinfo.h +++ b/sysdeps/powerpc/dl-procinfo.h @@ -1,5 +1,5 @@ /* Processor capability information handling macros. PowerPC version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 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 @@ -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,21 +65,14 @@ static inline const char * __attribute__ ((unused)) _dl_hwcap_string (int idx) { - return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST]; -} - -static inline const char * -__attribute__ ((unused)) -_dl_platform_string (int idx) -{ - return GLRO(dl_powerpc_platforms)[idx - _DL_FIRST_PLATFORM]; + return GLRO(dl_powerpc_cap_flags)[idx]; } 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; @@ -95,7 +85,7 @@ _dl_string_platform (const char *str) if (str == NULL) return -1; - if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0) + if (strncmp (str, "power", 5) == 0) { int ret; str += 5; @@ -135,35 +125,21 @@ _dl_string_platform (const char *str) if (str[1] == '\0') return ret; } - else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970], - 3) == 0) + else if (strncmp (str, "ppc", 3) == 0) { - if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970] - + 3) == 0) + if (strcmp (str + 3, "970") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3) - == 0) + else if (strcmp (str + 3, "-cell-be") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPCA2] + 3) - == 0) + else if (strcmp (str + 3, "a2") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPCA2; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC405] + 3) - == 0) + else if (strcmp (str + 3, "405") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC405; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC440] + 3) - == 0) + else if (strcmp (str + 3, "440") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC440; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC464] + 3) - == 0) + else if (strcmp (str + 3, "464") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC464; - else if (strcmp (str + 3, - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC476] + 3) - == 0) + else if (strcmp (str + 3, "476") == 0) return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC476; } @@ -180,7 +156,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; |