|
From: <sv...@va...> - 2007-09-11 13:52:02
|
Author: sewardj
Date: 2007-09-11 14:52:01 +0100 (Tue, 11 Sep 2007)
New Revision: 6819
Log:
Make thrcheck work on ppc32-linux.
Modified:
branches/THRCHECK/coregrind/m_syswrap/syswrap-ppc32-linux.c
branches/THRCHECK/thrcheck/tests/tc07_hbl1.c
branches/THRCHECK/thrcheck/tests/tc08_hbl2.c
Modified: branches/THRCHECK/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- branches/THRCHECK/coregrind/m_syswrap/syswrap-ppc32-linux.c 2007-09-11 10:26:28 UTC (rev 6818)
+++ branches/THRCHECK/coregrind/m_syswrap/syswrap-ppc32-linux.c 2007-09-11 13:52:01 UTC (rev 6819)
@@ -313,6 +313,12 @@
ctst->client_stack_szB = 0;
}
+ /* Assume the clone will succeed, and tell any tool that wants to
+ know that this thread has come into existence. If the clone
+ fails, we'll send out a ll_exit notification for it at the out:
+ label below, to clean up. */
+ VG_TRACK ( pre_thread_ll_create, ptid, ctid );
+
if (flags & VKI_CLONE_SETTLS) {
if (debug)
VG_(printf)("clone child has SETTLS: tls at %p\n", child_tls);
@@ -344,6 +350,8 @@
/* clone failed */
VG_(cleanup_thread)(&ctst->arch);
ctst->status = VgTs_Empty;
+ /* oops. Better tell the tool the thread exited in a hurry :-) */
+ VG_TRACK( pre_thread_ll_exit, ctid );
}
return res;
Modified: branches/THRCHECK/thrcheck/tests/tc07_hbl1.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc07_hbl1.c 2007-09-11 10:26:28 UTC (rev 6818)
+++ branches/THRCHECK/thrcheck/tests/tc07_hbl1.c 2007-09-11 13:52:01 UTC (rev 6819)
@@ -32,6 +32,17 @@
# define INC(_lval) \
__asm__ __volatile__ ( \
"lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" )
+#elif defined(PLAT_ppc32_linux)
+# define INC(_lval) \
+ __asm__ __volatile__( \
+ "1:\n" \
+ " lwarx 15,0,%0\n" \
+ " addi 15,15,1\n" \
+ " stwcx. 15,0,%0\n" \
+ " bne- 1b" \
+ : /*out*/ : /*in*/ "b"(&(_lval)) \
+ : /*trash*/ "r15", "cr0", "memory" \
+ )
#else
# error "Fix Me for this platform"
#endif
Modified: branches/THRCHECK/thrcheck/tests/tc08_hbl2.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc08_hbl2.c 2007-09-11 10:26:28 UTC (rev 6818)
+++ branches/THRCHECK/thrcheck/tests/tc08_hbl2.c 2007-09-11 13:52:01 UTC (rev 6819)
@@ -36,6 +36,17 @@
# define INC(_lval) \
__asm__ __volatile__ ( \
"lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" )
+#elif defined(PLAT_ppc32_linux)
+# define INC(_lval) \
+ __asm__ __volatile__( \
+ "1:\n" \
+ " lwarx 15,0,%0\n" \
+ " addi 15,15,1\n" \
+ " stwcx. 15,0,%0\n" \
+ " bne- 1b" \
+ : /*out*/ : /*in*/ "b"(&(_lval)) \
+ : /*trash*/ "r15", "cr0", "memory" \
+ )
#else
# error "Fix Me for this platform"
#endif
|