blob: e07f008488ab7c7f6bb67a347422d17c515db104 [file] [log] [blame]
sewardjaf44c822007-11-25 14:01:38 +00001#ifndef __DRD_CLIENTREQ_H
2#define __DRD_CLIENTREQ_H
3
4
5#include "valgrind.h" // VG_USERREQ_TOOL_BASE()
6
7
8enum {
9 /* Ask the core the thread ID assigned by Valgrind. */
10 VG_USERREQ__GET_THREAD_SELF = VG_USERREQ_TOOL_BASE('D', 'R'),
11 /* args: none. */
12 /* Set the name of the thread that performs this client request. */
13 VG_USERREQ__SET_THREAD_NAME,
14 /* args: null-terminated character string. */
15
16 /* To tell the drd tool to suppress data race detection on the specified */
17 /* address range. */
18 VG_USERREQ__DRD_START_SUPPRESSION,
19 /* args: start address, size in bytes */
20 /* To tell the drd tool no longer to suppress data race detection on the */
21 /* specified address range. */
22 VG_USERREQ__DRD_FINISH_SUPPRESSION,
23 /* args: start address, size in bytes */
24 /* Ask drd to suppress data race reports on all currently allocated stack */
25 /* data of the current thread. */
26 VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK,
27 /* args: none */
28 /* To ask the drd tool to start a new segment in the specified thread. */
29 VG_USERREQ__DRD_START_NEW_SEGMENT,
30 /* args: POSIX thread ID. */
31
32 /* To tell the drd tool to start again recording memory accesses for the */
33 /* specified thread. */
34 VG_USERREQ__DRD_START_RECORDING,
35 /* args: POSIX thread ID. */
36 /* To tell the drd tool to stop recording memory accesses for the */
37 /* specified thread. */
38 VG_USERREQ__DRD_STOP_RECORDING,
39 /* args: POSIX thread ID. */
40
41 /* Tell the core the pthread_t of the running thread */
42 VG_USERREQ__SET_PTHREADID,
43 /* args: pthread_t. */
44 /* Ask the core that a the thread's state transition from */
45 /* VgTs_Zombie to VgTs_Empty is delayed until */
46 /* VG_USERREQ__POST_THREAD_JOIN is performed. */
47 VG_USERREQ__SET_JOINABLE,
48 /* args: pthread_t, Bool */
49
50 /* To notify drd that a thread finished because */
51 /* pthread_thread_join() was called on it. */
52 VG_USERREQ__POST_THREAD_JOIN,
53 /* args: pthread_t (joinee) */
54
55 /* To notify the core of a pthread_mutex_init call */
56 VG_USERREQ__PRE_MUTEX_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000057 /* args: Addr, MutexT */
sewardjaf44c822007-11-25 14:01:38 +000058 /* To notify the core of a pthread_mutex_destroy call */
59 VG_USERREQ__POST_MUTEX_DESTROY,
sewardj721ad7b2007-11-30 08:30:29 +000060 /* args: Addr, SizeT, MutexT */
sewardjaf44c822007-11-25 14:01:38 +000061 /* To notify the core of pthread_mutex_lock calls */
62 VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK,
sewardj721ad7b2007-11-30 08:30:29 +000063 /* args: Addr, SizeT, MutexT */
sewardjaf44c822007-11-25 14:01:38 +000064 /* To notify the core of pthread_mutex_lock calls */
65 VG_USERREQ__POST_PTHREAD_MUTEX_LOCK,
sewardj721ad7b2007-11-30 08:30:29 +000066 /* args: Addr, SizeT, MutexT */
sewardjaf44c822007-11-25 14:01:38 +000067 /* To notify the core of pthread_mutex_unlock calls */
68 VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK,
69 /* args: Addr */
70 VG_USERREQ__SPIN_INIT_OR_UNLOCK,
71 /* args: Addr spinlock, SizeT size */
72
73
74 /* To notify the core of a pthread_cond_init call */
75 VG_USERREQ__POST_PTHREAD_COND_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000076 /* args: Addr */
sewardjaf44c822007-11-25 14:01:38 +000077 /* To notify the core of a pthread_cond_destroy call */
78 VG_USERREQ__PRE_PTHREAD_COND_DESTROY,
sewardj721ad7b2007-11-30 08:30:29 +000079 /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */
sewardjaf44c822007-11-25 14:01:38 +000080 VG_USERREQ__PRE_PTHREAD_COND_WAIT,
sewardj721ad7b2007-11-30 08:30:29 +000081 /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */
sewardjaf44c822007-11-25 14:01:38 +000082 VG_USERREQ__POST_PTHREAD_COND_WAIT,
sewardj721ad7b2007-11-30 08:30:29 +000083 /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */
sewardjaf44c822007-11-25 14:01:38 +000084 VG_USERREQ__PRE_PTHREAD_COND_SIGNAL,
85 /* args: Addr cond */
86 VG_USERREQ__PRE_PTHREAD_COND_BROADCAST,
87 /* args: Addr cond */
88
89};
90
sewardj721ad7b2007-11-30 08:30:29 +000091typedef enum
92{
93 mutex_type_mutex = 1,
94 mutex_type_spinlock = 2,
95} MutexT;
sewardjaf44c822007-11-25 14:01:38 +000096
97
98#endif // __DRD_CLIENTREQ_H