1#ifndef QEMU_TSAN_H
2#define QEMU_TSAN_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifdef CONFIG_TSAN
24
25
26
27#define QEMU_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) \
28 AnnotateHappensBefore(__FILE__, __LINE__, (void *)(addr))
29#define QEMU_TSAN_ANNOTATE_HAPPENS_AFTER(addr) \
30 AnnotateHappensAfter(__FILE__, __LINE__, (void *)(addr))
31
32
33
34
35#define QEMU_TSAN_ANNOTATE_THREAD_NAME(name) \
36 AnnotateThreadName(__FILE__, __LINE__, (void *)(name))
37
38
39
40
41#define QEMU_TSAN_ANNOTATE_IGNORE_READS_BEGIN() \
42 AnnotateIgnoreReadsBegin(__FILE__, __LINE__)
43#define QEMU_TSAN_ANNOTATE_IGNORE_READS_END() \
44 AnnotateIgnoreReadsEnd(__FILE__, __LINE__)
45
46
47
48
49
50#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN() \
51 AnnotateIgnoreWritesBegin(__FILE__, __LINE__)
52#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_END() \
53 AnnotateIgnoreWritesEnd(__FILE__, __LINE__)
54#else
55#define QEMU_TSAN_ANNOTATE_HAPPENS_BEFORE(addr)
56#define QEMU_TSAN_ANNOTATE_HAPPENS_AFTER(addr)
57#define QEMU_TSAN_ANNOTATE_THREAD_NAME(name)
58#define QEMU_TSAN_ANNOTATE_IGNORE_READS_BEGIN()
59#define QEMU_TSAN_ANNOTATE_IGNORE_READS_END()
60#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN()
61#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_END()
62#endif
63
64void AnnotateHappensBefore(const char *f, int l, void *addr);
65void AnnotateHappensAfter(const char *f, int l, void *addr);
66void AnnotateThreadName(const char *f, int l, char *name);
67void AnnotateIgnoreReadsBegin(const char *f, int l);
68void AnnotateIgnoreReadsEnd(const char *f, int l);
69void AnnotateIgnoreWritesBegin(const char *f, int l);
70void AnnotateIgnoreWritesEnd(const char *f, int l);
71#endif
72