]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Modularised the thread/pthread modelling stuff.
authorNicholas Nethercote <njn@valgrind.org>
Sat, 11 Jun 2005 01:07:00 +0000 (01:07 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 11 Jun 2005 01:07:00 +0000 (01:07 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3877

coregrind/Makefile.am
coregrind/core.h
coregrind/m_pthreadmodel.c [moved from coregrind/vg_pthreadmodel.c with 98% similarity]
coregrind/m_threadmodel.c [moved from coregrind/vg_threadmodel.c with 99% similarity]
coregrind/pub_core_pthreadmodel.h [new file with mode: 0644]
coregrind/pub_core_threadmodel.h [new file with mode: 0644]

index 3769b9273e103ec67e5966eec2b25e0279c78706..dc84701a693508d476f8fa71db93cb21535a1a91 100644 (file)
@@ -55,6 +55,7 @@ noinst_HEADERS = \
        pub_core_mallocfree.h   \
        pub_core_options.h      \
        pub_core_profile.h      \
+       pub_core_pthreadmodel.h \
        pub_core_redir.h        \
        pub_core_replacemalloc.h\
        pub_core_scheduler.h    \
@@ -63,6 +64,7 @@ noinst_HEADERS = \
        pub_core_skiplist.h     \
        pub_core_stacktrace.h   \
        pub_core_syscalls.h     \
+       pub_core_threadmodel.h  \
        pub_core_tooliface.h    \
        pub_core_translate.h    \
        pub_core_transtab.h     \
@@ -101,18 +103,18 @@ stage2_SOURCES = \
        m_mallocfree.c \
        m_options.c \
        m_profile.c \
+       m_pthreadmodel.c \
        m_redir.c \
        m_signals.c \
        m_skiplist.c \
        m_stacktrace.c \
+       m_threadmodel.c \
        m_tooliface.c \
        m_translate.c \
        m_transtab.c \
        \
        ume.c \
-       vg_mylibc.c \
-       vg_threadmodel.c \
-       vg_pthreadmodel.c
+       vg_mylibc.c
 
 ## Nb: libscheduler.a must precede libdispatch.a in this list.
 stage2_extra= \
index 378027e3af32aacfe1666e1887e18379e0a82766..1774511b86c4a759ed01c6c7f066e389417ab8f8 100644 (file)
@@ -238,46 +238,6 @@ extern void VGA_(intercept_libc_freeres_wrapper)(Addr);
 // Clean up the client by calling before the final reports
 extern void VGA_(final_tidyup)(ThreadId tid);
 
-///* ---------------------------------------------------------------------
-//   Thread modelling
-//   ------------------------------------------------------------------ */
-//extern void VG_(tm_thread_create)  (ThreadId creator, ThreadId tid, Bool detached);
-//extern void VG_(tm_thread_exit)    (ThreadId tid);
-//extern Bool VG_(tm_thread_exists)  (ThreadId tid);
-//extern void VG_(tm_thread_detach)  (ThreadId tid);
-//extern void VG_(tm_thread_join)    (ThreadId joiner, ThreadId joinee);
-//extern void VG_(tm_thread_switchto)(ThreadId tid);
-//
-//extern void VG_(tm_mutex_init)   (ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_destroy)(ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_trylock)(ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_giveup) (ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_acquire)(ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_tryunlock)(ThreadId tid, Addr mutexp);
-//extern void VG_(tm_mutex_unlock) (ThreadId tid, Addr mutexp);
-//extern Bool VG_(tm_mutex_exists) (Addr mutexp);
-//
-//extern UInt VG_(tm_error_update_extra) (Error *err);
-//extern Bool VG_(tm_error_equal) (VgRes res, Error *e1, Error *e2);
-//extern void VG_(tm_error_print) (Error *err);
-//
-//extern void VG_(tm_init) ();
-//
-//extern void VG_(tm_cond_init)    (ThreadId tid, Addr condp);
-//extern void VG_(tm_cond_destroy) (ThreadId tid, Addr condp);
-//extern void VG_(tm_cond_wait)    (ThreadId tid, Addr condp, Addr mutexp);
-//extern void VG_(tm_cond_wakeup)  (ThreadId tid, Addr condp, Addr mutexp);
-//extern void VG_(tm_cond_signal)  (ThreadId tid, Addr condp);
-//
-///* ----- pthreads ----- */
-//extern void VG_(pthread_init)      ();
-//extern void VG_(pthread_startfunc_wrapper)(Addr wrapper);
-//
-//struct vg_pthread_newthread_data {
-//   void      *(*startfunc)(void *arg);
-//   void *arg;
-//};
-
 /* ---------------------------------------------------------------------
    Finally - autoconf-generated settings
    ------------------------------------------------------------------ */
similarity index 98%
rename from coregrind/vg_pthreadmodel.c
rename to coregrind/m_pthreadmodel.c
index a54c62bbe2c1f549afc7b4bd9315ad539c6e0623..33fd2bf6283c1aaec85d0bbe88acf9de94b8a8b9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*--------------------------------------------------------------------*/
-/*--- Pthreads library  modelling.               vg_pthreadmodel.c ---*/
+/*--- Pthreads library modelling.                 m_pthreadmodel.c ---*/
 /*--------------------------------------------------------------------*/
 
 /*
@@ -598,3 +598,7 @@ void VG_(pthread_init)()
 //:: {
 //:: }
 #endif /* 0 */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
similarity index 99%
rename from coregrind/vg_threadmodel.c
rename to coregrind/m_threadmodel.c
index 69399edabd51400b00c1536c84f773216096080e..c92043047649fb76bb6896228d980b32ae9579c5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*--------------------------------------------------------------------*/
-/*--- Thread modelling.                           vg_threadmodel.c ---*/
+/*--- Thread modelling.                            m_threadmodel.c ---*/
 /*--------------------------------------------------------------------*/
 
 /*
 //:: {
 //::    VG_(needs_core_errors)();
 //:: }
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/coregrind/pub_core_pthreadmodel.h b/coregrind/pub_core_pthreadmodel.h
new file mode 100644 (file)
index 0000000..9b3a9eb
--- /dev/null
@@ -0,0 +1,50 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Pthread modelling.                   pub_core_pthreadmodel.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2005 Jeremy Fitzhardinge
+      jeremy@goop.org
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_PTHREADMODEL_H
+#define __PUB_CORE_PTHREADMODEL_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module does pthread modelling stuff...
+//--------------------------------------------------------------------
+
+//extern void VG_(pthread_init)      ();
+//extern void VG_(pthread_startfunc_wrapper)(Addr wrapper);
+//
+//struct vg_pthread_newthread_data {
+//   void      *(*startfunc)(void *arg);
+//   void *arg;
+//};
+
+#endif   // __PUB_CORE_PTHREADMODEL_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/coregrind/pub_core_threadmodel.h b/coregrind/pub_core_threadmodel.h
new file mode 100644 (file)
index 0000000..292ea89
--- /dev/null
@@ -0,0 +1,70 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Thread modelling.                     pub_core_threadmodel.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2005 Jeremy Fitzhardinge
+      jeremy@goop.org
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_THREADMODEL_H
+#define __PUB_CORE_THREADMODEL_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module does thread modelling stuff...
+//--------------------------------------------------------------------
+
+//extern void VG_(tm_thread_create)  (ThreadId creator, ThreadId tid, Bool detached);
+//extern void VG_(tm_thread_exit)    (ThreadId tid);
+//extern Bool VG_(tm_thread_exists)  (ThreadId tid);
+//extern void VG_(tm_thread_detach)  (ThreadId tid);
+//extern void VG_(tm_thread_join)    (ThreadId joiner, ThreadId joinee);
+//extern void VG_(tm_thread_switchto)(ThreadId tid);
+//
+//extern void VG_(tm_mutex_init)   (ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_destroy)(ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_trylock)(ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_giveup) (ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_acquire)(ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_tryunlock)(ThreadId tid, Addr mutexp);
+//extern void VG_(tm_mutex_unlock) (ThreadId tid, Addr mutexp);
+//extern Bool VG_(tm_mutex_exists) (Addr mutexp);
+//
+//extern UInt VG_(tm_error_update_extra) (Error *err);
+//extern Bool VG_(tm_error_equal) (VgRes res, Error *e1, Error *e2);
+//extern void VG_(tm_error_print) (Error *err);
+//
+//extern void VG_(tm_init) ();
+//
+//extern void VG_(tm_cond_init)    (ThreadId tid, Addr condp);
+//extern void VG_(tm_cond_destroy) (ThreadId tid, Addr condp);
+//extern void VG_(tm_cond_wait)    (ThreadId tid, Addr condp, Addr mutexp);
+//extern void VG_(tm_cond_wakeup)  (ThreadId tid, Addr condp, Addr mutexp);
+//extern void VG_(tm_cond_signal)  (ThreadId tid, Addr condp);
+
+#endif   // __PUB_CORE_THREADMODEL_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/