sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 1 | #ifndef __DRD_CLIENTREQ_H |
| 2 | #define __DRD_CLIENTREQ_H |
| 3 | |
| 4 | |
| 5 | #include "valgrind.h" // VG_USERREQ_TOOL_BASE() |
| 6 | |
| 7 | |
| 8 | enum { |
| 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 | |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 55 | /* to notify the drd tool of a pthread_mutex_init call. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 56 | VG_USERREQ__PRE_MUTEX_INIT, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 57 | /* args: Addr, MutexT */ |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 58 | /* to notify the drd tool of a pthread_mutex_destroy call. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 59 | VG_USERREQ__POST_MUTEX_DESTROY, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 60 | /* args: Addr, SizeT, MutexT */ |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 61 | /* to notify the drd tool of pthread_mutex_lock calls */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 62 | VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 63 | /* args: Addr, SizeT, MutexT */ |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 64 | /* to notify the drd tool of pthread_mutex_lock calls */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 65 | VG_USERREQ__POST_PTHREAD_MUTEX_LOCK, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 66 | /* args: Addr, SizeT, MutexT */ |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 67 | /* to notify the drd tool of pthread_mutex_unlock calls */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 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 | |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 74 | /* to notify the drd tool of a pthread_cond_init call. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 75 | VG_USERREQ__POST_PTHREAD_COND_INIT, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 76 | /* args: Addr */ |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 77 | /* to notify the drd tool of a pthread_cond_destroy call. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 78 | VG_USERREQ__PRE_PTHREAD_COND_DESTROY, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 79 | /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 80 | VG_USERREQ__PRE_PTHREAD_COND_WAIT, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 81 | /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 82 | VG_USERREQ__POST_PTHREAD_COND_WAIT, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 83 | /* args: Addr cond, SizeT cond_size, Addr mutex, SizeT mutex_size */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 84 | VG_USERREQ__PRE_PTHREAD_COND_SIGNAL, |
| 85 | /* args: Addr cond */ |
| 86 | VG_USERREQ__PRE_PTHREAD_COND_BROADCAST, |
| 87 | /* args: Addr cond */ |
| 88 | |
sewardj | 8564292 | 2008-01-14 11:54:56 +0000 | [diff] [blame^] | 89 | /* 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 | |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 118 | }; |
| 119 | |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 120 | typedef enum |
| 121 | { |
| 122 | mutex_type_mutex = 1, |
| 123 | mutex_type_spinlock = 2, |
| 124 | } MutexT; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 125 | |
| 126 | |
| 127 | #endif // __DRD_CLIENTREQ_H |