summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/dl-procinfo.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-12-19 15:30:39 +0000
committerUlrich Drepper <drepper@redhat.com>2006-12-19 15:30:39 +0000
commit594d423aa3ed05263d386ff32af9edcf6a7696fc (patch)
tree63f980182ee45d5038b6e603732b842c80ea8296 /sysdeps/powerpc/dl-procinfo.h
parent5bcba0ed52c291c1758a8daf24a7ed1680b0330f (diff)
downloadglibc-594d423aa3ed05263d386ff32af9edcf6a7696fc.tar.gz
* elf/dl-support.c: Include dl-procinfo.h.
* sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4, PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS, PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X): Define. (_dl_string_platform): Use PPC_PLATFORM_* macros instead of hardcoded constants. * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use PPC_PLATFORM_* macros for array designators. 2006-11-11 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap names to the beginning. (_dl_powerpc_platforms): Add "power6x". * sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease. (HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP. (_DL_PLATFORMS_COUNT): Increase. (_dl_string_platform): Handle power6x case. * sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP, PPC_FEATURE_POWER6_EXT): Define. (PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment.
Diffstat (limited to 'sysdeps/powerpc/dl-procinfo.h')
-rw-r--r--sysdeps/powerpc/dl-procinfo.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index f63da6d555..0bf935385a 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -24,19 +24,29 @@
#include <sysdep.h> /* This defines the PPC_FEATURE_* macros. */
/* There are 20 bits used, but they are bits 12..31. */
-#define _DL_HWCAP_FIRST 12
+#define _DL_HWCAP_FIRST 9
#define _DL_HWCAP_COUNT 32
/* These bits influence library search. */
-#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC)
+#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \
+ + PPC_FEATURE_HAS_DFP)
-#define _DL_PLATFORMS_COUNT 6
+#define _DL_PLATFORMS_COUNT 7
#define _DL_FIRST_PLATFORM 32
/* Mask to filter out platforms. */
#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
<< _DL_FIRST_PLATFORM)
+/* Platform bits (relative to _DL_FIRST_PLATFORM). */
+#define PPC_PLATFORM_POWER4 0
+#define PPC_PLATFORM_PPC970 1
+#define PPC_PLATFORM_POWER5 2
+#define PPC_PLATFORM_POWER5_PLUS 3
+#define PPC_PLATFORM_POWER6 4
+#define PPC_PLATFORM_CELL_BE 5
+#define PPC_PLATFORM_POWER6X 6
+
static inline const char *
__attribute__ ((unused))
_dl_hwcap_string (int idx)
@@ -68,22 +78,30 @@ _dl_string_platform (const char *str)
if (str == NULL)
return -1;
- if (strncmp (str, GLRO(dl_powerpc_platforms)[0], 5) == 0)
+ if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
{
int ret;
str += 5;
switch (*str)
{
case '4':
- ret = _DL_FIRST_PLATFORM + 0;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
break;
case '5':
- ret = _DL_FIRST_PLATFORM + 2;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
if (str[1] == '+')
- ++ret, ++str;
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
+ ++str;
+ }
break;
case '6':
- ret = _DL_FIRST_PLATFORM + 4;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
+ if (str[1] == 'x')
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
+ ++str;
+ }
break;
default:
return -1;
@@ -91,12 +109,16 @@ _dl_string_platform (const char *str)
if (str[1] == '\0')
return ret;
}
- else if (strncmp (str, GLRO(dl_powerpc_platforms)[1], 3) == 0)
+ else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
+ 3) == 0)
{
- if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[1] + 3) == 0)
- return _DL_FIRST_PLATFORM + 1;
- else if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[5] + 3) == 0)
- return _DL_FIRST_PLATFORM + 5;
+ if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
+ + 3) == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
}
return -1;