From: Nicholas Nethercote Date: Sat, 11 Jun 2005 01:07:00 +0000 (+0000) Subject: Modularised the thread/pthread modelling stuff. X-Git-Tag: svn/VALGRIND_3_0_0~441 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e57f4956f70cbcd940d2bd666ac59ce44a05e0e;p=thirdparty%2Fvalgrind.git Modularised the thread/pthread modelling stuff. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3877 --- diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 3769b9273e..dc84701a69 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -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= \ diff --git a/coregrind/core.h b/coregrind/core.h index 378027e3af..1774511b86 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -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 ------------------------------------------------------------------ */ diff --git a/coregrind/vg_pthreadmodel.c b/coregrind/m_pthreadmodel.c similarity index 98% rename from coregrind/vg_pthreadmodel.c rename to coregrind/m_pthreadmodel.c index a54c62bbe2..33fd2bf628 100644 --- a/coregrind/vg_pthreadmodel.c +++ b/coregrind/m_pthreadmodel.c @@ -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 ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/vg_threadmodel.c b/coregrind/m_threadmodel.c similarity index 99% rename from coregrind/vg_threadmodel.c rename to coregrind/m_threadmodel.c index 69399edabd..c920430476 100644 --- a/coregrind/vg_threadmodel.c +++ b/coregrind/m_threadmodel.c @@ -1,6 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- Thread modelling. vg_threadmodel.c ---*/ +/*--- Thread modelling. m_threadmodel.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -1235,3 +1235,7 @@ //:: { //:: VG_(needs_core_errors)(); //:: } + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/pub_core_pthreadmodel.h b/coregrind/pub_core_pthreadmodel.h new file mode 100644 index 0000000000..9b3a9ebcb2 --- /dev/null +++ b/coregrind/pub_core_pthreadmodel.h @@ -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 index 0000000000..292ea89584 --- /dev/null +++ b/coregrind/pub_core_threadmodel.h @@ -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 ---*/ +/*--------------------------------------------------------------------*/