]> git.ipfire.org Git - thirdparty/gcc.git/blame - libsanitizer/tsan/tsan_interface.h
[libsanitizer] merge from upstream r168514
[thirdparty/gcc.git] / libsanitizer / tsan / tsan_interface.h
CommitLineData
cd0be65c
WM
1//===-- tsan_interface.h ----------------------------------------*- C++ -*-===//
2//
3// This file is distributed under the University of Illinois Open Source
4// License. See LICENSE.TXT for details.
5//
6//===----------------------------------------------------------------------===//
7//
8// This file is a part of ThreadSanitizer (TSan), a race detector.
9//
10// The functions declared in this header will be inserted by the instrumentation
11// module.
12// This header can be included by the instrumented program or by TSan tests.
13//===----------------------------------------------------------------------===//
14#ifndef TSAN_INTERFACE_H
15#define TSAN_INTERFACE_H
16
cd0be65c
WM
17// This header should NOT include any other headers.
18// All functions in this header are extern "C" and start with __tsan_.
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24// This function should be called at the very beginning of the process,
25// before any instrumented code is executed and before any call to malloc.
e297eb60 26void __tsan_init();
cd0be65c 27
e297eb60
KS
28void __tsan_read1(void *addr);
29void __tsan_read2(void *addr);
30void __tsan_read4(void *addr);
31void __tsan_read8(void *addr);
32void __tsan_read16(void *addr);
cd0be65c 33
e297eb60
KS
34void __tsan_write1(void *addr);
35void __tsan_write2(void *addr);
36void __tsan_write4(void *addr);
37void __tsan_write8(void *addr);
38void __tsan_write16(void *addr);
cd0be65c 39
e297eb60 40void __tsan_vptr_update(void **vptr_p, void *new_val);
cd0be65c 41
e297eb60
KS
42void __tsan_func_entry(void *call_pc);
43void __tsan_func_exit();
cd0be65c
WM
44
45#ifdef __cplusplus
46} // extern "C"
47#endif
48
49#endif // TSAN_INTERFACE_H