|
From: <sv...@va...> - 2006-11-14 14:32:54
|
Author: dirk
Date: 2006-11-14 14:32:46 +0000 (Tue, 14 Nov 2006)
New Revision: 6350
Log:
change void* to Addr in mutex helpers. patch by Bard Van Assche.=20
I've bumped the tool interface version because it seems binary
incompatible.
Modified:
trunk/coregrind/m_threadmodel.c
trunk/coregrind/m_tooliface.c
trunk/coregrind/pub_core_tooliface.h
trunk/helgrind/hg_main.c
trunk/include/pub_tool_tooliface.h
Modified: trunk/coregrind/m_threadmodel.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_threadmodel.c 2006-11-10 22:47:27 UTC (rev 6349)
+++ trunk/coregrind/m_threadmodel.c 2006-11-14 14:32:46 UTC (rev 6350)
@@ -808,7 +808,7 @@
if (mx->state =3D=3D MX_Locked && mx->owner =3D=3D tid) /* deadlock *=
/
mutex_report(tid, mutexp, MXE_Deadlock, "trylocking");
=20
- VG_TRACK( pre_mutex_lock, tid, (void *)mutexp );
+ VG_TRACK( pre_mutex_lock, tid, mutexp );
}
=20
/* Give up waiting for a mutex. Fails if:
@@ -835,7 +835,7 @@
=20
switch(mx->state) {
case MX_Unlocking: /* ownership transfer or relock */
- VG_TRACK( post_mutex_unlock, mx->owner, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, mx->owner, mutexp );
if (mx->owner !=3D tid)
thread_unblock_mutex(tid, mx, "acquiring mutex");
break;
@@ -847,7 +847,7 @@
case MX_Locked:
if (debug_mutex)
VG_(printf)("mutex=3D%p mx->state=3D%s\n", mutexp, pp_mutexstate(mx));
- VG_TRACK( post_mutex_unlock, mx->owner, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, mx->owner, mutexp );
mutex_report(tid, mutexp, MXE_Locked, "acquiring");
thread_unblock_mutex(tid, mx, "acquiring mutex");
break;
@@ -860,7 +860,7 @@
mx->owner =3D tid;
mutex_setstate(tid, mx, MX_Locked);
=20
- VG_TRACK( post_mutex_lock, tid, (void *)mutexp );
+ VG_TRACK( post_mutex_lock, tid, mutexp );
}
=20
/* Try unlocking a lock. This will move it into a state where it can
@@ -969,7 +969,7 @@
=20
case MX_Unlocking:
/* OK - we need to complete the unlock */
- VG_TRACK( post_mutex_unlock, tid, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, tid, mutexp );
mutex_setstate(tid, mx, MX_Free);
break;
=20
Modified: trunk/coregrind/m_tooliface.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_tooliface.c 2006-11-10 22:47:27 UTC (rev 6349)
+++ trunk/coregrind/m_tooliface.c 2006-11-14 14:32:46 UTC (rev 6350)
@@ -326,9 +326,9 @@
DEF(track_post_thread_create, ThreadId, ThreadId)
DEF(track_post_thread_join, ThreadId, ThreadId)
=20
-DEF(track_pre_mutex_lock, ThreadId, void*)
-DEF(track_post_mutex_lock, ThreadId, void*)
-DEF(track_post_mutex_unlock, ThreadId, void*)
+DEF(track_pre_mutex_lock, ThreadId, Addr)
+DEF(track_post_mutex_lock, ThreadId, Addr)
+DEF(track_post_mutex_unlock, ThreadId, Addr)
=20
DEF(track_pre_deliver_signal, ThreadId, Int sigNo, Bool)
DEF(track_post_deliver_signal, ThreadId, Int sigNo)
Modified: trunk/coregrind/pub_core_tooliface.h
=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/pub_core_tooliface.h 2006-11-10 22:47:27 UTC (rev 634=
9)
+++ trunk/coregrind/pub_core_tooliface.h 2006-11-14 14:32:46 UTC (rev 635=
0)
@@ -205,9 +205,9 @@
void (*track_post_thread_create)(ThreadId, ThreadId);
void (*track_post_thread_join) (ThreadId, ThreadId);
=20
- void (*track_pre_mutex_lock) (ThreadId, void*);
- void (*track_post_mutex_lock) (ThreadId, void*);
- void (*track_post_mutex_unlock)(ThreadId, void*);
+ void (*track_pre_mutex_lock) (ThreadId, Addr);
+ void (*track_post_mutex_lock) (ThreadId, Addr);
+ void (*track_post_mutex_unlock)(ThreadId, Addr);
=20
void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);
void (*track_post_deliver_signal)(ThreadId, Int sigNo);
Modified: trunk/helgrind/hg_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/helgrind/hg_main.c 2006-11-10 22:47:27 UTC (rev 6349)
+++ trunk/helgrind/hg_main.c 2006-11-14 14:32:46 UTC (rev 6350)
@@ -2858,17 +2858,17 @@
/* Do nothing */
}
=20
-static void hg_pre_mutex_lock(ThreadId tid, void* void_mutex)
+static void hg_pre_mutex_lock(ThreadId tid, Addr client_mutex)
{
- Mutex *mutex =3D get_mutex((Addr)void_mutex);
+ Mutex *mutex =3D get_mutex(client_mutex);
=20
test_mutex_state(mutex, MxLocked, tid);
}
=20
-static void hg_post_mutex_lock(ThreadId tid, void* void_mutex)
+static void hg_post_mutex_lock(ThreadId tid, Addr client_mutex)
{
static const Bool debug =3D False;
- Mutex *mutex =3D get_mutex((Addr)void_mutex);
+ Mutex *mutex =3D get_mutex(client_mutex);
const LockSet* ls;
=20
set_mutex_state(mutex, MxLocked, tid);
@@ -2899,11 +2899,11 @@
}
=20
=20
-static void hg_post_mutex_unlock(ThreadId tid, void* void_mutex)
+static void hg_post_mutex_unlock(ThreadId tid, Addr client_mutex)
{
static const Bool debug =3D False;
Int i =3D 0;
- Mutex *mutex =3D get_mutex((Addr)void_mutex);
+ Mutex *mutex =3D get_mutex(client_mutex);
const LockSet *ls;
=20
test_mutex_state(mutex, MxUnlocked, tid);
@@ -3260,14 +3260,14 @@
static void bus_lock(void)
{
ThreadId tid =3D VG_(get_running_tid)();
- hg_pre_mutex_lock(tid, &__BUS_HARDWARE_LOCK__);
- hg_post_mutex_lock(tid, &__BUS_HARDWARE_LOCK__);
+ hg_pre_mutex_lock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
+ hg_post_mutex_lock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
}
=20
static void bus_unlock(void)
{
ThreadId tid =3D VG_(get_running_tid)();
- hg_post_mutex_unlock(tid, &__BUS_HARDWARE_LOCK__);
+ hg_post_mutex_unlock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
}
=20
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_tooliface.h
=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/include/pub_tool_tooliface.h 2006-11-10 22:47:27 UTC (rev 6349)
+++ trunk/include/pub_tool_tooliface.h 2006-11-14 14:32:46 UTC (rev 6350)
@@ -40,7 +40,7 @@
/* The version number indicates binary-incompatible changes to the
interface; if the core and tool versions don't match, Valgrind
will abort. */
-#define VG_CORE_INTERFACE_VERSION 9
+#define VG_CORE_INTERFACE_VERSION 10
=20
typedef struct _ToolInfo {
Int sizeof_ToolInfo;
@@ -553,15 +553,15 @@
=20
Called before a thread can block while waiting for a mutex (called
regardless of whether the thread will block or not). */
-void VG_(track_pre_mutex_lock)(void(*f)(ThreadId tid, void* mutex));
+void VG_(track_pre_mutex_lock)(void(*f)(ThreadId tid, Addr mutex));
=20
/* Called once the thread actually holds the mutex (always paired with
pre_mutex_lock). */
-void VG_(track_post_mutex_lock)(void(*f)(ThreadId tid, void* mutex));
+void VG_(track_post_mutex_lock)(void(*f)(ThreadId tid, Addr mutex));
=20
/* Called after a thread has released a mutex (no need for a correspondi=
ng
pre_mutex_unlock, because unlocking can't block). */
-void VG_(track_post_mutex_unlock)(void(*f)(ThreadId tid, void* mutex));
+void VG_(track_post_mutex_unlock)(void(*f)(ThreadId tid, Addr mutex));
=20
/* Signal events (not exhaustive)
=20
|