DRD updates (Bart Van Assche):

- Updated copyright statement: replaced 2006-2007 by 2006-2008.
- Added copyright statement in the files where it was missing
(drd_track.h and drd_clientreq.c)
- Eliminated dependencies on core header files -- there are no more
#include "pub_core....h" directives in the exp-drd source code.
- Added semaphore support.
- Added barrier support.
- Added pthread_mutex_timedlock() support.
- Stack depth of stack traces printed by exp-drd can now be set via
--num-callers=...
- Added command-line option --trace-barrier=[yes|no].
- Added regression test for pthread_barrier() (matinv, a program that
performs matrix inversion).
- Added regression test sem_as_mutex, which tests whether race
detection works correctly when a semaphore is used to ensure mutual
exclusion of critical sections.
- Some of helgrind's regression tests are now used to test both
helgrind and exp-drd: tc17_sembar and tc18_semabuse.
- Cleaned up bitmap implementation code now that the const keyword has
been added to the declarations of the OSet functions.
- Cleaned up exp-drd/Makefile.am
- Updated exp-drd/TODO.txt




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7346 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/drd_clientreq.c b/exp-drd/drd_clientreq.c
index d77c741..ac4b045 100644
--- a/exp-drd/drd_clientreq.c
+++ b/exp-drd/drd_clientreq.c
@@ -1,11 +1,36 @@
+/*
+  This file is part of drd, a data race detector.
+
+  Copyright (C) 2006-2008 Bart Van Assche
+  bart.vanassche@gmail.com
+
+  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.
+*/
+
+
 #include "drd_clientreq.h"
 #include "drd_cond.h"
 #include "drd_mutex.h"
+#include "drd_semaphore.h"
 #include "drd_suppression.h"      // drd_start_suppression()
 #include "drd_thread.h"
 #include "drd_track.h"
 #include "priv_drd_clientreq.h"
-#include "pub_core_tooliface.h"   // VG_TRACK()
 #include "pub_tool_basics.h"      // Bool
 #include "pub_tool_libcassert.h"
 #include "pub_tool_libcassert.h"  // tl_assert()
@@ -155,6 +180,42 @@
       drd_pre_cond_broadcast(arg[1]);
       break;
 
+   case VG_USERREQ__SEM_INIT:
+      drd_semaphore_init(arg[1], arg[2], arg[3], arg[4]);
+      break;
+
+   case VG_USERREQ__SEM_DESTROY:
+      drd_semaphore_destroy(arg[1]);
+      break;
+
+   case VG_USERREQ__POST_SEM_WAIT:
+      drd_semaphore_post_wait(thread_get_running_tid(), arg[1], arg[2]);
+      break;
+
+   case VG_USERREQ__PRE_SEM_POST:
+      drd_semaphore_pre_post(thread_get_running_tid(), arg[1], arg[2]);
+      break;
+
+   case VG_USERREQ__POST_SEM_POST:
+      drd_semaphore_post_post(thread_get_running_tid(), arg[1], arg[2]);
+      break;
+
+   case VG_USERREQ__BARRIER_INIT:
+      drd_barrier_init(arg[1], arg[2], arg[3]);
+      break;
+
+   case VG_USERREQ__BARRIER_DESTROY:
+      drd_barrier_destroy(arg[1]);
+      break;
+
+   case VG_USERREQ__PRE_BARRIER_WAIT:
+      drd_barrier_pre_wait(thread_get_running_tid(), arg[1]);
+      break;
+
+   case VG_USERREQ__POST_BARRIER_WAIT:
+      drd_barrier_post_wait(thread_get_running_tid(), arg[1], arg[2]);
+      break;
+
    default:
       VG_(message)(Vg_DebugMsg, "Unrecognized client request 0x%lx 0x%lx",
                    arg[0], arg[1]);