blob: 4d7d4f3457bb428eb5cb743855601d131bd6c337 [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
sewardj85642922008-01-14 11:54:56 +000055 /* to notify the drd tool of a pthread_mutex_init call. */
sewardjaf44c822007-11-25 14:01:38 +000056 VG_USERREQ__PRE_MUTEX_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000057 /* args: Addr, MutexT */
sewardj85642922008-01-14 11:54:56 +000058 /* to notify the drd tool of a pthread_mutex_destroy call. */
sewardjaf44c822007-11-25 14:01:38 +000059 VG_USERREQ__POST_MUTEX_DESTROY,
sewardj721ad7b2007-11-30 08:30:29 +000060 /* args: Addr, SizeT, MutexT */
sewardj85642922008-01-14 11:54:56 +000061 /* to notify the drd tool of pthread_mutex_lock calls */
sewardjaf44c822007-11-25 14:01:38 +000062 VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK,
sewardj721ad7b2007-11-30 08:30:29 +000063 /* args: Addr, SizeT, MutexT */
sewardj85642922008-01-14 11:54:56 +000064 /* to notify the drd tool of pthread_mutex_lock calls */
sewardjaf44c822007-11-25 14:01:38 +000065 VG_USERREQ__POST_PTHREAD_MUTEX_LOCK,
sewardj721ad7b2007-11-30 08:30:29 +000066 /* args: Addr, SizeT, MutexT */
sewardj85642922008-01-14 11:54:56 +000067 /* to notify the drd tool of pthread_mutex_unlock calls */
sewardjaf44c822007-11-25 14:01:38 +000068 VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK,
69 /* args: Addr */
70 VG_USERREQ__SPIN_INIT_OR_UNLOCK,
71 /* args: Addr spinlock, SizeT size */
72
73
sewardj85642922008-01-14 11:54:56 +000074 /* to notify the drd tool of a pthread_cond_init call. */
sewardjaf44c822007-11-25 14:01:38 +000075 VG_USERREQ__POST_PTHREAD_COND_INIT,
sewardj721ad7b2007-11-30 08:30:29 +000076 /* args: Addr */
sewardj85642922008-01-14 11:54:56 +000077 /* to notify the drd tool of a pthread_cond_destroy call. */
sewardjaf44c822007-11-25 14:01:38 +000078 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
sewardj85642922008-01-14 11:54:56 +000089 /* To notify the drd tool of a sem_init call. */
90 VG_USERREQ__SEM_INIT,
91 /* args: Addr sem, SizeT sem_size, Word pshared, Word value */
92 /* To notify the drd tool of a sem_destroy call. */
93 VG_USERREQ__SEM_DESTROY,
94 /* args: Addr sem */
95 /* To notify the drd tool of a sem_wait call. */
96 VG_USERREQ__POST_SEM_WAIT,
97 /* args: Addr sem, SizeT sem_size */
98 /* To notify the drd tool before a sem_post call. */
99 VG_USERREQ__PRE_SEM_POST,
100 /* args: Addr sem, SizeT sem_size */
101 /* To notify the drd tool after a sem_post call. */
102 VG_USERREQ__POST_SEM_POST,
103 /* args: Addr sem, SizeT sem_size */
104
105 /* To notify the drd tool of a pthread_barrier_init call. */
106 VG_USERREQ__BARRIER_INIT,
107 /* args: Addr barrier, SizeT barrier_size, Word count */
108 /* To notify the drd tool of a pthread_barrier_destroy call. */
109 VG_USERREQ__BARRIER_DESTROY,
110 /* args: Addr barrier */
111 /* To notify the drd tool of a pthread_barrier_wait call. */
112 VG_USERREQ__PRE_BARRIER_WAIT,
113 /* args: Addr barrier */
114 /* To notify the drd tool of a pthread_barrier_wait call. */
115 VG_USERREQ__POST_BARRIER_WAIT,
116 /* args: Addr barrier, Word has_waited */
117
sewardjaf44c822007-11-25 14:01:38 +0000118};
119
sewardj721ad7b2007-11-30 08:30:29 +0000120typedef enum
121{
122 mutex_type_mutex = 1,
123 mutex_type_spinlock = 2,
124} MutexT;
sewardjaf44c822007-11-25 14:01:38 +0000125
126
127#endif // __DRD_CLIENTREQ_H