blob: 5d4e7aacf9777e13e8ba3cdeb2dc13172bf6a865 [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,
bart5e85d262008-03-01 10:49:37 +000019 /* args: start address, end address */
sewardjaf44c822007-11-25 14:01:38 +000020 /* To tell the drd tool no longer to suppress data race detection on the */
21 /* specified address range. */
22 VG_USERREQ__DRD_FINISH_SUPPRESSION,
bart5e85d262008-03-01 10:49:37 +000023 /* args: start address, end address */
sewardjaf44c822007-11-25 14:01:38 +000024 /* 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
sewardjaf44c822007-11-25 14:01:38 +000032 /* Tell the core the pthread_t of the running thread */
33 VG_USERREQ__SET_PTHREADID,
34 /* args: pthread_t. */
35 /* Ask the core that a the thread's state transition from */
36 /* VgTs_Zombie to VgTs_Empty is delayed until */
37 /* VG_USERREQ__POST_THREAD_JOIN is performed. */
38 VG_USERREQ__SET_JOINABLE,
39 /* args: pthread_t, Bool */
40
41 /* To notify drd that a thread finished because */
42 /* pthread_thread_join() was called on it. */
43 VG_USERREQ__POST_THREAD_JOIN,
44 /* args: pthread_t (joinee) */
45
sewardj85642922008-01-14 11:54:56 +000046 /* to notify the drd tool of a pthread_mutex_init call. */
sewardjaf44c822007-11-25 14:01:38 +000047 VG_USERREQ__PRE_MUTEX_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000048 /* args: Addr, MutexT */
sewardj85642922008-01-14 11:54:56 +000049 /* to notify the drd tool of a pthread_mutex_destroy call. */
sewardjaf44c822007-11-25 14:01:38 +000050 VG_USERREQ__POST_MUTEX_DESTROY,
sewardj721ad7b2007-11-30 08:30:29 +000051 /* args: Addr, SizeT, MutexT */
sewardj85642922008-01-14 11:54:56 +000052 /* to notify the drd tool of pthread_mutex_lock calls */
sewardjaf44c822007-11-25 14:01:38 +000053 VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK,
sewardj721ad7b2007-11-30 08:30:29 +000054 /* args: Addr, SizeT, MutexT */
sewardj85642922008-01-14 11:54:56 +000055 /* to notify the drd tool of pthread_mutex_lock calls */
sewardjaf44c822007-11-25 14:01:38 +000056 VG_USERREQ__POST_PTHREAD_MUTEX_LOCK,
bart00344642008-03-01 15:27:41 +000057 /* args: Addr, Bool */
sewardj85642922008-01-14 11:54:56 +000058 /* to notify the drd tool of pthread_mutex_unlock calls */
sewardjaf44c822007-11-25 14:01:38 +000059 VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK,
60 /* args: Addr */
61 VG_USERREQ__SPIN_INIT_OR_UNLOCK,
62 /* args: Addr spinlock, SizeT size */
63
64
sewardj85642922008-01-14 11:54:56 +000065 /* to notify the drd tool of a pthread_cond_init call. */
bart72b751c2008-03-01 13:44:24 +000066 VG_USERREQ__PRE_PTHREAD_COND_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000067 /* args: Addr */
sewardj85642922008-01-14 11:54:56 +000068 /* to notify the drd tool of a pthread_cond_destroy call. */
bart72b751c2008-03-01 13:44:24 +000069 VG_USERREQ__POST_PTHREAD_COND_DESTROY,
bart3b1ee452008-02-29 19:28:15 +000070 /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size,MutexT mt*/
sewardjaf44c822007-11-25 14:01:38 +000071 VG_USERREQ__PRE_PTHREAD_COND_WAIT,
bart5357fcb2008-02-27 15:46:00 +000072 /* args: Addr cond, SizeT cond_size, Addr mutex, MutexT mt */
sewardjaf44c822007-11-25 14:01:38 +000073 VG_USERREQ__POST_PTHREAD_COND_WAIT,
bart00344642008-03-01 15:27:41 +000074 /* args: Addr cond, Addr mutex, Bool took_lock*/
sewardjaf44c822007-11-25 14:01:38 +000075 VG_USERREQ__PRE_PTHREAD_COND_SIGNAL,
76 /* args: Addr cond */
77 VG_USERREQ__PRE_PTHREAD_COND_BROADCAST,
78 /* args: Addr cond */
79
sewardj85642922008-01-14 11:54:56 +000080 /* To notify the drd tool of a sem_init call. */
81 VG_USERREQ__SEM_INIT,
82 /* args: Addr sem, SizeT sem_size, Word pshared, Word value */
83 /* To notify the drd tool of a sem_destroy call. */
84 VG_USERREQ__SEM_DESTROY,
85 /* args: Addr sem */
86 /* To notify the drd tool of a sem_wait call. */
bart28230a32008-02-29 17:27:03 +000087 VG_USERREQ__PRE_SEM_WAIT,
sewardj85642922008-01-14 11:54:56 +000088 /* args: Addr sem, SizeT sem_size */
bart28230a32008-02-29 17:27:03 +000089 /* To notify the drd tool of a sem_wait call. */
90 VG_USERREQ__POST_SEM_WAIT,
91 /* args: Addr sem, Bool waited */
sewardj85642922008-01-14 11:54:56 +000092 /* To notify the drd tool before a sem_post call. */
93 VG_USERREQ__PRE_SEM_POST,
94 /* args: Addr sem, SizeT sem_size */
95 /* To notify the drd tool after a sem_post call. */
96 VG_USERREQ__POST_SEM_POST,
sewardje3b57aa2008-01-18 07:42:01 +000097 /* args: Addr sem, SizeT sem_size, Bool waited */
sewardj85642922008-01-14 11:54:56 +000098
99 /* To notify the drd tool of a pthread_barrier_init call. */
100 VG_USERREQ__BARRIER_INIT,
101 /* args: Addr barrier, SizeT barrier_size, Word count */
102 /* To notify the drd tool of a pthread_barrier_destroy call. */
103 VG_USERREQ__BARRIER_DESTROY,
104 /* args: Addr barrier */
105 /* To notify the drd tool of a pthread_barrier_wait call. */
106 VG_USERREQ__PRE_BARRIER_WAIT,
107 /* args: Addr barrier */
108 /* To notify the drd tool of a pthread_barrier_wait call. */
109 VG_USERREQ__POST_BARRIER_WAIT,
110 /* args: Addr barrier, Word has_waited */
111
bart00344642008-03-01 15:27:41 +0000112 /* To notify the drd tool of a pthread_rwlock_init call. */
113 VG_USERREQ__PRE_RWLOCK_INIT,
114 /* args: Addr rwlock, SizeT size */
115 /* To notify the drd tool of a pthread_rwlock_destroy call. */
116 VG_USERREQ__POST_RWLOCK_DESTROY,
117 /* args: Addr rwlock, SizeT size */
118 /* To notify the drd tool of a pthread_rwlock_rdlock call. */
119 VG_USERREQ__PRE_RWLOCK_RDLOCK,
120 /* args: Addr rwlock, SizeT size */
121 /* To notify the drd tool of a pthread_rwlock_rdlock call. */
122 VG_USERREQ__POST_RWLOCK_RDLOCK,
123 /* args: Addr rwlock, Bool took_lock */
124 /* To notify the drd tool of a pthread_rwlock_wrlock call. */
125 VG_USERREQ__PRE_RWLOCK_WRLOCK,
126 /* args: Addr rwlock, SizeT size */
127 /* To notify the drd tool of a pthread_rwlock_wrlock call. */
128 VG_USERREQ__POST_RWLOCK_WRLOCK,
129 /* args: Addr rwlock, Bool took_lock */
130 /* To notify the drd tool of a pthread_rwlock_unlock call. */
131 VG_USERREQ__POST_RWLOCK_UNLOCK,
132 /* args: Addr rwlock, Bool unlocked */
133
sewardjaf44c822007-11-25 14:01:38 +0000134};
135
sewardj721ad7b2007-11-30 08:30:29 +0000136typedef enum
137{
bart635cb162008-02-28 08:30:43 +0000138 mutex_type_invalid_mutex = 0,
bart5357fcb2008-02-27 15:46:00 +0000139 mutex_type_recursive_mutex = 1,
140 mutex_type_errorcheck_mutex = 2,
141 mutex_type_default_mutex = 3,
142 mutex_type_spinlock = 4,
sewardj721ad7b2007-11-30 08:30:29 +0000143} MutexT;
sewardjaf44c822007-11-25 14:01:38 +0000144
145
146#endif // __DRD_CLIENTREQ_H