blob: 24394fbeb751e38407544a795b5699e1c3dcfaf3 [file] [log] [blame]
sewardj7f3ad222002-11-13 22:11:53 +00001/*
2 ----------------------------------------------------------------
3
4 Notice that the following BSD-style license applies to this one
weidendo2dc84802006-03-31 12:53:22 +00005 file (helgrind.h) only. The rest of Valgrind is licensed under the
njn7fd15d62006-03-31 12:05:04 +00006 terms of the GNU General Public License, version 2, unless
7 otherwise indicated. See the COPYING file in the source
8 distribution for details.
sewardj7f3ad222002-11-13 22:11:53 +00009
10 ----------------------------------------------------------------
11
nethercote137bc552003-11-14 17:47:54 +000012 This file is part of helgrind, a Valgrind tool for detecting
sewardj7f3ad222002-11-13 22:11:53 +000013 data races in threaded programs.
14
sewardj9ebd6e02007-01-08 06:01:59 +000015 Copyright (C) 2002-2007 Nicholas Nethercote. All rights reserved.
sewardj7f3ad222002-11-13 22:11:53 +000016
17 Redistribution and use in source and binary forms, with or without
18 modification, are permitted provided that the following conditions
19 are met:
20
21 1. Redistributions of source code must retain the above copyright
22 notice, this list of conditions and the following disclaimer.
23
24 2. The origin of this software must not be misrepresented; you must
25 not claim that you wrote the original software. If you use this
26 software in a product, an acknowledgment in the product
27 documentation would be appreciated but is not required.
28
29 3. Altered source versions must be plainly marked as such, and must
30 not be misrepresented as being the original software.
31
32 4. The name of the author may not be used to endorse or promote
33 products derived from this software without specific prior written
34 permission.
35
36 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
37 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
40 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
42 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
45 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
48 ----------------------------------------------------------------
49
50 Notice that the above BSD-style license applies to this one file
51 (helgrind.h) only. The entire rest of Valgrind is licensed under
52 the terms of the GNU General Public License, version 2. See the
53 COPYING file in the source distribution for details.
54
55 ----------------------------------------------------------------
56*/
57
58#ifndef __HELGRIND_H
59#define __HELGRIND_H
60
sewardj7f3ad222002-11-13 22:11:53 +000061#include "valgrind.h"
62
63typedef
64 enum {
njnfc26ff92004-11-22 19:12:49 +000065 VG_USERREQ__HG_CLEAN_MEMORY = VG_USERREQ_TOOL_BASE('H','G'),
sewardj34a257c2003-03-15 19:20:52 +000066 VG_USERREQ__HG_KNOWN_RACE
sewardj7f3ad222002-11-13 22:11:53 +000067 } Vg_HelgrindClientRequest;
68
69/* Clean memory state. This makes Helgrind forget everything it knew
70 about the specified memory range, and resets it to virgin. This is
71 particularly useful for memory allocators who wish to recycle
72 memory. */
73#define VALGRIND_HG_CLEAN_MEMORY(_qzz_start, _qzz_len) \
74 do { \
75 unsigned int _qzz_res; \
76 VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__HG_CLEAN_MEMORY, \
77 _qzz_start, _qzz_len, 0, 0); \
78 (void)0; \
79 } while(0)
80
81/* Mark memory as known racy. This puts the memory range specified
82 into the error state, so that data race errors are not reported
83 against it. */
84#define VALGRIND_HG_KNOWN_RACE(_qzz_start, _qzz_len) \
85 do { \
86 unsigned int _qzz_res; \
87 VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__HG_KNOWN_RACE, \
88 _qzz_start, _qzz_len, 0, 0); \
89 (void)0; \
90 } while(0)
91
92#endif /* __HELGRIND_H */