summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/dl-procinfo.c13
-rw-r--r--sysdeps/powerpc/dl-procinfo.h48
-rw-r--r--sysdeps/powerpc/sysdep.h9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S4
4 files changed, 52 insertions, 22 deletions
diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c
index 196f9bd65c..a732e94fa8 100644
--- a/sysdeps/powerpc/dl-procinfo.c
+++ b/sysdeps/powerpc/dl-procinfo.c
@@ -46,10 +46,11 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_powerpc_cap_flags
#else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10]
#endif
#ifndef PROCINFO_DECL
= {
+ "power6x", "dfp", "pa6t",
"arch_2_05", "ic_snoop", "smt", "booke",
"cellbe", "power5+", "power5", "power4",
"notb", "efpdouble", "efpsingle", "spe",
@@ -66,11 +67,17 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10]
#if !defined PROCINFO_DECL && defined SHARED
._dl_powerpc_platforms
#else
-PROCINFO_CLASS const char _dl_powerpc_platforms[6][12]
+PROCINFO_CLASS const char _dl_powerpc_platforms[7][12]
#endif
#ifndef PROCINFO_DECL
= {
- "power4", "ppc970", "power5", "power5+", "power6", "ppc-cell-be"
+ [PPC_PLATFORM_POWER4] = "power4",
+ [PPC_PLATFORM_PPC970] = "ppc970",
+ [PPC_PLATFORM_POWER5] = "power5",
+ [PPC_PLATFORM_POWER5_PLUS] = "power5+",
+ [PPC_PLATFORM_POWER6] = "power6",
+ [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
+ [PPC_PLATFORM_POWER6X] = "power6x"
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
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;
diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index a376e4dac3..2ae52b78c0 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -34,13 +34,16 @@
#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
#define PPC_FEATURE_NO_TB 0x00100000 /* 601/403gx have no timebase */
#define PPC_FEATURE_POWER4 0x00080000 /* POWER4 ISA 2.00 */
-#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.01 */
-#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.02 */
+#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */
+#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */
#define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */
#define PPC_FEATURE_BOOKE 0x00008000
-#define PPC_FEATURE_SMT 0x00004000
+#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */
#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
+#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
+#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
+#define PPC_FEATURE_POWER6_EXT 0x00000200 /* P6 + mffgpr/mftgpr */
#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
#ifdef __ASSEMBLER__
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
index 208a375ef3..9451f9eb36 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
@@ -26,9 +26,7 @@
ENTRY(__makecontext)
/* Set up the first 7 args to the function in its registers */
- addi r11,r3,_UC_REG_SPACE+12
- clrrwi r11,r11,4
- stw r11,_UC_REGS_PTR(r3)
+ lwz r11,_UC_REGS_PTR(r3)
stw r6,_UC_GREGS+(PT_R3*4)(r11)
stw r7,_UC_GREGS+(PT_R4*4)(r11)
stw r8,_UC_GREGS+(PT_R5*4)(r11)