|
From: <sv...@va...> - 2005-12-08 03:24:42
|
Author: cerion
Date: 2005-12-08 03:24:37 +0000 (Thu, 08 Dec 2005)
New Revision: 5314
Log:
More V setup for ppc64
- client stack setup
- init_thread1state: set TOC ptr
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2005-12-07 22:20:19=
UTC (rev 5313)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2005-12-08 03:24:37=
UTC (rev 5314)
@@ -256,7 +256,7 @@
ldx 5, 5,4
/* r6 =3D VG_(tt_fast)[r30 & VG_TT_FAST_MASK]->orig_addr */
ld 6, 0(5)
- cmpw 30,6
+ cmpd 30,6
bne .fast_lookup_failed
=20
/* increment bb profile counter VG_(tt_fastN)[x] (=3D32bit val) =
*/
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-12-07 22:20:19 UTC (rev 5313)
+++ trunk/coregrind/m_main.c 2005-12-08 03:24:37 UTC (rev 5314)
@@ -370,7 +370,7 @@
auxsize +=3D sizeof(*cauxv);
}
=20
-# if defined(VGP_ppc32_linux)
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
auxsize +=3D 2 * sizeof(*cauxv);
# endif
=20
@@ -487,7 +487,7 @@
auxv =3D (struct ume_auxv *)ptr;
*client_auxv =3D (UInt *)auxv;
=20
-# if defined(VGP_ppc32_linux)
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
auxv[0].a_type =3D AT_IGNOREPPC;
auxv[0].u.a_val =3D AT_IGNOREPPC;
auxv[1].a_type =3D AT_IGNOREPPC;
@@ -559,10 +559,18 @@
"PPC32 cache line size %u (type %u)\n",=20
(UInt)auxv->u.a_val, (UInt)auxv->a_type =
);
}
+# elif defined(VGP_ppc64_linux)
+ /* acquire cache info */
+ if (auxv->u.a_val > 0) {
+ VG_(machine_ppc64_set_clszB)( auxv->u.a_val );
+ VG_(debugLog)(2, "main",=20
+ "PPC64 cache line size %u (type %u)\n",=20
+ (UInt)auxv->u.a_val, (UInt)auxv->a_type =
);
+ }
# endif
break;
=20
-# if defined(VGP_ppc32_linux)
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
case AT_IGNOREPPC:
break;
# endif
@@ -578,7 +586,7 @@
break;
=20
case AT_SYSINFO:
-# if !defined(VGP_ppc32_linux)
+# if !defined(VGP_ppc32_linux) && !defined(VGP_ppc64_linux)
case AT_SYSINFO_EHDR:
# endif
/* Trash this, because we don't reproduce it */
@@ -1692,6 +1700,7 @@
*/
static void init_thread1state ( Addr client_ip,=20
Addr client_sp,
+ Addr entry,
/*inout*/ ThreadArchState* arch )
{
#if defined(VGA_x86)
@@ -1754,8 +1763,8 @@
=20
/* Put essential stuff into the new state. */
arch->vex.guest_GPR1 =3D client_sp;
+ arch->vex.guest_GPR2 =3D ((ULong*)entry)[1]; // TOC ptr
arch->vex.guest_CIA =3D client_ip;
-
#else
# error Unknown arch
#endif
@@ -2477,6 +2486,7 @@
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise thread 1's state\n");
init_thread1state( initial_client_IP, initial_client_SP,=20
+ info.entry,
&VG_(threads)[1].arch);
=20
//--------------------------------------------------------------
|