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 | |
| 55 | /* To notify the core of a pthread_mutex_init call */ |
| 56 | VG_USERREQ__PRE_MUTEX_INIT, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 57 | /* args: Addr, MutexT */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 58 | /* To notify the core of a pthread_mutex_destroy call */ |
| 59 | VG_USERREQ__POST_MUTEX_DESTROY, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 60 | /* args: Addr, SizeT, MutexT */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 61 | /* To notify the core of pthread_mutex_lock calls */ |
| 62 | VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 63 | /* args: Addr, SizeT, MutexT */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 64 | /* To notify the core of pthread_mutex_lock calls */ |
| 65 | VG_USERREQ__POST_PTHREAD_MUTEX_LOCK, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 66 | /* args: Addr, SizeT, MutexT */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 67 | /* 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, |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 76 | /* args: Addr */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 77 | /* To notify the core of a pthread_cond_destroy call */ |
| 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 | |
| 89 | }; |
| 90 | |
sewardj | 721ad7b | 2007-11-30 08:30:29 +0000 | [diff] [blame] | 91 | typedef enum |
| 92 | { |
| 93 | mutex_type_mutex = 1, |
| 94 | mutex_type_spinlock = 2, |
| 95 | } MutexT; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 96 | |
| 97 | |
| 98 | #endif // __DRD_CLIENTREQ_H |