]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
change void* to Addr in mutex helpers. patch by Bard Van Assche.
authorDirk Mueller <daywalker@users.sourceforge.net>
Tue, 14 Nov 2006 14:32:46 +0000 (14:32 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Tue, 14 Nov 2006 14:32:46 +0000 (14:32 +0000)
I've bumped the tool interface version because it seems binary
incompatible.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6350

coregrind/m_threadmodel.c
coregrind/m_tooliface.c
coregrind/pub_core_tooliface.h
helgrind/hg_main.c
include/pub_tool_tooliface.h

index 5bd5b7e68c4bb3111eed8d1a7dddaa9f2b3082ce..fa3e20854bb693ec5bd08171b4a278d4868497f7 100644 (file)
@@ -808,7 +808,7 @@ void VG_(tm_mutex_trylock)(ThreadId tid, Addr mutexp)
    if (mx->state == MX_Locked && mx->owner == tid) /* deadlock */
       mutex_report(tid, mutexp, MXE_Deadlock, "trylocking");
 
-   VG_TRACK( pre_mutex_lock, tid, (void *)mutexp );
+   VG_TRACK( pre_mutex_lock, tid, mutexp );
 }
 
 /* Give up waiting for a mutex.  Fails if:
@@ -835,7 +835,7 @@ void VG_(tm_mutex_acquire)(ThreadId tid, Addr mutexp)
    
    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 != tid)
         thread_unblock_mutex(tid, mx, "acquiring mutex");
       break;
@@ -847,7 +847,7 @@ void VG_(tm_mutex_acquire)(ThreadId tid, Addr mutexp)
    case MX_Locked:
       if (debug_mutex)
         VG_(printf)("mutex=%p mx->state=%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 @@ void VG_(tm_mutex_acquire)(ThreadId tid, Addr mutexp)
    mx->owner = tid;
    mutex_setstate(tid, mx, MX_Locked);
 
-   VG_TRACK( post_mutex_lock, tid, (void *)mutexp );
+   VG_TRACK( post_mutex_lock, tid, mutexp );
 }
 
 /* Try unlocking a lock.  This will move it into a state where it can
@@ -969,7 +969,7 @@ void VG_(tm_mutex_unlock)(ThreadId tid, Addr mutexp)
 
    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;
 
index a5c16e9e08e865fbe4d47585321cfe894f1caa6a..843ac5b1090afc822b89e94825e6851184c6f4fb 100644 (file)
@@ -326,9 +326,9 @@ DEF(track_thread_run,            ThreadId)
 DEF(track_post_thread_create,    ThreadId, ThreadId)
 DEF(track_post_thread_join,      ThreadId, ThreadId)
 
-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)
 
 DEF(track_pre_deliver_signal,    ThreadId, Int sigNo, Bool)
 DEF(track_post_deliver_signal,   ThreadId, Int sigNo)
index 21833e37b5e4b6790fbc185004d2a3c577962d9c..bde51bdef86b80348293e4268af48dd0b813d4b8 100644 (file)
@@ -205,9 +205,9 @@ typedef struct {
    void (*track_post_thread_create)(ThreadId, ThreadId);
    void (*track_post_thread_join)  (ThreadId, ThreadId);
 
-   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);
 
    void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);
    void (*track_post_deliver_signal)(ThreadId, Int sigNo);
index 1a256151a1124004e12a38f8b3f5a6aa26f616b6..cda5858fc6cfc1dd3fb40e00c08183546dbf9bec 100644 (file)
@@ -2858,17 +2858,17 @@ static void hg_print_extra_suppression_info ( Error* err )
    /* Do nothing */
 }
 
-static void hg_pre_mutex_lock(ThreadId tid, void* void_mutex)
+static void hg_pre_mutex_lock(ThreadId tid, Addr client_mutex)
 {
-   Mutex *mutex = get_mutex((Addr)void_mutex);
+   Mutex *mutex = get_mutex(client_mutex);
 
    test_mutex_state(mutex, MxLocked, tid);
 }
 
-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 = False;
-   Mutex *mutex = get_mutex((Addr)void_mutex);
+   Mutex *mutex = get_mutex(client_mutex);
    const LockSet*  ls;
 
    set_mutex_state(mutex, MxLocked, tid);
@@ -2899,11 +2899,11 @@ static void hg_post_mutex_lock(ThreadId tid, void* void_mutex)
 }
 
 
-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 = False;
    Int i = 0;
-   Mutex *mutex = get_mutex((Addr)void_mutex);
+   Mutex *mutex = get_mutex(client_mutex);
    const LockSet *ls;
 
    test_mutex_state(mutex, MxUnlocked, tid);
@@ -3260,14 +3260,14 @@ static Int __BUS_HARDWARE_LOCK__;
 static void bus_lock(void)
 {
    ThreadId tid = 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__);
 }
 
 static void bus_unlock(void)
 {
    ThreadId tid = VG_(get_running_tid)();
-   hg_post_mutex_unlock(tid, &__BUS_HARDWARE_LOCK__);
+   hg_post_mutex_unlock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
 }
 
 /*--------------------------------------------------------------------*/
index 849aabf35a81498511713ebbdf6f6a2376a6c407..ecdad5fc8e900e55f3ca1483ecefa506adb2e4de 100644 (file)
@@ -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
 
 typedef struct _ToolInfo {
    Int sizeof_ToolInfo;
@@ -553,15 +553,15 @@ void VG_(track_post_thread_join)  (void(*f)(ThreadId joiner, ThreadId joinee));
 
    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));
 
 /* 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));
 
 /* Called after a thread has released a mutex (no need for a corresponding
    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));
 
 /* Signal events (not exhaustive)