1//===-- tsan_interface.h ----------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file is a part of ThreadSanitizer (TSan), a race detector.
10//
11// The functions declared in this header will be inserted by the instrumentation
12// module.
13// This header can be included by the instrumented program or by TSan tests.
14//===----------------------------------------------------------------------===//
15#ifndef TSAN_INTERFACE_H
16#define TSAN_INTERFACE_H
17
18#include <sanitizer_common/sanitizer_internal_defs.h>
19using __sanitizer::uptr;
20using __sanitizer::tid_t;
21
22// This header should NOT include any other headers.
23// All functions in this header are extern "C" and start with __tsan_.
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#if !SANITIZER_GO
30
31// This function should be called at the very beginning of the process,
32// before any instrumented code is executed and before any call to malloc.
33SANITIZER_INTERFACE_ATTRIBUTE void __tsan_init();
34
35SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *
36__tsan_default_options();
37
38SANITIZER_INTERFACE_ATTRIBUTE void __tsan_flush_memory();
39
40SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1(void *addr);
41SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read2(void *addr);
42SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read4(void *addr);
43SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read8(void *addr);
44SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read16(void *addr);
45
46SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write1(void *addr);
47SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write2(void *addr);
48SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write4(void *addr);
49SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write8(void *addr);
50SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write16(void *addr);
51
52SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read2(const void *addr);
53SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read4(const void *addr);
54SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read8(const void *addr);
55SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read16(const void *addr);
56
57SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write2(void *addr);
58SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write4(void *addr);
59SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write8(void *addr);
60SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write16(void *addr);
61
62SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1_pc(void *addr, void *pc);
63SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read2_pc(void *addr, void *pc);
64SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read4_pc(void *addr, void *pc);
65SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read8_pc(void *addr, void *pc);
66SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read16_pc(void *addr, void *pc);
67
68SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write1_pc(void *addr, void *pc);
69SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write2_pc(void *addr, void *pc);
70SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write4_pc(void *addr, void *pc);
71SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write8_pc(void *addr, void *pc);
72SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write16_pc(void *addr, void *pc);
73
74SANITIZER_INTERFACE_ATTRIBUTE void __tsan_vptr_read(void **vptr_p);
75SANITIZER_INTERFACE_ATTRIBUTE
76void __tsan_vptr_update(void **vptr_p, void *new_val);
77
78SANITIZER_INTERFACE_ATTRIBUTE
79void *__tsan_memcpy(void *dest, const void *src, uptr count);
80SANITIZER_INTERFACE_ATTRIBUTE
81void *__tsan_memset(void *dest, int ch, uptr count);
82SANITIZER_INTERFACE_ATTRIBUTE
83void *__tsan_memmove(void *dest, const void *src, uptr count);
84
85SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_entry(void *call_pc);
86SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_exit();
87
88SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_begin();
89SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_end();
90
91SANITIZER_INTERFACE_ATTRIBUTE void __tsan_on_thread_idle();
92
93SANITIZER_INTERFACE_ATTRIBUTE
94void *__tsan_external_register_tag(const char *object_type);
95SANITIZER_INTERFACE_ATTRIBUTE
96void __tsan_external_register_header(void *tag, const char *header);
97SANITIZER_INTERFACE_ATTRIBUTE
98void __tsan_external_assign_tag(void *addr, void *tag);
99SANITIZER_INTERFACE_ATTRIBUTE
100void __tsan_external_read(void *addr, void *caller_pc, void *tag);
101SANITIZER_INTERFACE_ATTRIBUTE
102void __tsan_external_write(void *addr, void *caller_pc, void *tag);
103
104SANITIZER_INTERFACE_ATTRIBUTE
105void __tsan_read_range(void *addr, unsigned long size);
106SANITIZER_INTERFACE_ATTRIBUTE
107void __tsan_write_range(void *addr, unsigned long size);
108
109SANITIZER_INTERFACE_ATTRIBUTE
110void __tsan_read_range_pc(void *addr, unsigned long size, void *pc);
111SANITIZER_INTERFACE_ATTRIBUTE
112void __tsan_write_range_pc(void *addr, unsigned long size, void *pc);
113
114// User may provide function that would be called right when TSan detects
115// an error. The argument 'report' is an opaque pointer that can be used to
116// gather additional information using other TSan report API functions.
117SANITIZER_INTERFACE_ATTRIBUTE
118void __tsan_on_report(void *report);
119
120// If TSan is currently reporting a detected issue on the current thread,
121// returns an opaque pointer to the current report. Otherwise returns NULL.
122SANITIZER_INTERFACE_ATTRIBUTE
123void *__tsan_get_current_report();
124
125// Returns a report's description (issue type), number of duplicate issues
126// found, counts of array data (stack traces, memory operations, locations,
127// mutexes, threads, unique thread IDs) and a stack trace of a sleep() call (if
128// one was involved in the issue).
129SANITIZER_INTERFACE_ATTRIBUTE
130int __tsan_get_report_data(void *report, const char **description, int *count,
131 int *stack_count, int *mop_count, int *loc_count,
132 int *mutex_count, int *thread_count,
133 int *unique_tid_count, void **sleep_trace,
134 uptr trace_size);
135
136/// Retrieves the "tag" from a report (for external-race report types). External
137/// races can be associated with a tag which give them more meaning. For example
138/// tag value '1' means "Swift access race". Tag value '0' indicated a plain
139/// external race.
140///
141/// \param report opaque pointer to the current report (obtained as argument in
142/// __tsan_on_report, or from __tsan_get_current_report)
143/// \param [out] tag points to storage that will be filled with the tag value
144///
145/// \returns non-zero value on success, zero on failure
146SANITIZER_INTERFACE_ATTRIBUTE
147int __tsan_get_report_tag(void *report, uptr *tag);
148
149// Returns information about stack traces included in the report.
150SANITIZER_INTERFACE_ATTRIBUTE
151int __tsan_get_report_stack(void *report, uptr idx, void **trace,
152 uptr trace_size);
153
154// Returns information about memory operations included in the report.
155SANITIZER_INTERFACE_ATTRIBUTE
156int __tsan_get_report_mop(void *report, uptr idx, int *tid, void **addr,
157 int *size, int *write, int *atomic, void **trace,
158 uptr trace_size);
159
160// Returns information about locations included in the report.
161SANITIZER_INTERFACE_ATTRIBUTE
162int __tsan_get_report_loc(void *report, uptr idx, const char **type,
163 void **addr, uptr *start, uptr *size, int *tid,
164 int *fd, int *suppressable, void **trace,
165 uptr trace_size);
166
167SANITIZER_INTERFACE_ATTRIBUTE
168int __tsan_get_report_loc_object_type(void *report, uptr idx,
169 const char **object_type);
170
171// Returns information about mutexes included in the report.
172SANITIZER_INTERFACE_ATTRIBUTE
173int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,
174 int *destroyed, void **trace, uptr trace_size);
175
176// Returns information about threads included in the report.
177SANITIZER_INTERFACE_ATTRIBUTE
178int __tsan_get_report_thread(void *report, uptr idx, int *tid, tid_t *os_id,
179 int *running, const char **name, int *parent_tid,
180 void **trace, uptr trace_size);
181
182// Returns information about unique thread IDs included in the report.
183SANITIZER_INTERFACE_ATTRIBUTE
184int __tsan_get_report_unique_tid(void *report, uptr idx, int *tid);
185
186// Returns the type of the pointer (heap, stack, global, ...) and if possible
187// also the starting address (e.g. of a heap allocation) and size.
188SANITIZER_INTERFACE_ATTRIBUTE
189const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,
190 uptr *region_address, uptr *region_size);
191
192// Returns the allocation stack for a heap pointer.
193SANITIZER_INTERFACE_ATTRIBUTE
194int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id,
195 tid_t *os_id);
196
197#endif // SANITIZER_GO
198
199#ifdef __cplusplus
200} // extern "C"
201#endif
202
203namespace __tsan {
204
205// These should match declarations from public tsan_interface_atomic.h header.
206typedef unsigned char a8;
207typedef unsigned short a16;
208typedef unsigned int a32;
209typedef unsigned long long a64;
210#if !SANITIZER_GO && (defined(__SIZEOF_INT128__) \
211 || (__clang_major__ * 100 + __clang_minor__ >= 302)) && \
212 !defined(__mips64) && !defined(__s390x__)
213__extension__ typedef __int128 a128;
214# define __TSAN_HAS_INT128 1
215#else
216# define __TSAN_HAS_INT128 0
217#endif
218
219// Part of ABI, do not change.
220// https://github.com/llvm/llvm-project/blob/main/libcxx/include/atomic
221typedef enum {
222 mo_relaxed,
223 mo_consume,
224 mo_acquire,
225 mo_release,
226 mo_acq_rel,
227 mo_seq_cst
228} morder;
229
230struct ThreadState;
231
232extern "C" {
233SANITIZER_INTERFACE_ATTRIBUTE
234a8 __tsan_atomic8_load(const volatile a8 *a, morder mo);
235SANITIZER_INTERFACE_ATTRIBUTE
236a16 __tsan_atomic16_load(const volatile a16 *a, morder mo);
237SANITIZER_INTERFACE_ATTRIBUTE
238a32 __tsan_atomic32_load(const volatile a32 *a, morder mo);
239SANITIZER_INTERFACE_ATTRIBUTE
240a64 __tsan_atomic64_load(const volatile a64 *a, morder mo);
241#if __TSAN_HAS_INT128
242SANITIZER_INTERFACE_ATTRIBUTE
243a128 __tsan_atomic128_load(const volatile a128 *a, morder mo);
244#endif
245
246SANITIZER_INTERFACE_ATTRIBUTE
247void __tsan_atomic8_store(volatile a8 *a, a8 v, morder mo);
248SANITIZER_INTERFACE_ATTRIBUTE
249void __tsan_atomic16_store(volatile a16 *a, a16 v, morder mo);
250SANITIZER_INTERFACE_ATTRIBUTE
251void __tsan_atomic32_store(volatile a32 *a, a32 v, morder mo);
252SANITIZER_INTERFACE_ATTRIBUTE
253void __tsan_atomic64_store(volatile a64 *a, a64 v, morder mo);
254#if __TSAN_HAS_INT128
255SANITIZER_INTERFACE_ATTRIBUTE
256void __tsan_atomic128_store(volatile a128 *a, a128 v, morder mo);
257#endif
258
259SANITIZER_INTERFACE_ATTRIBUTE
260a8 __tsan_atomic8_exchange(volatile a8 *a, a8 v, morder mo);
261SANITIZER_INTERFACE_ATTRIBUTE
262a16 __tsan_atomic16_exchange(volatile a16 *a, a16 v, morder mo);
263SANITIZER_INTERFACE_ATTRIBUTE
264a32 __tsan_atomic32_exchange(volatile a32 *a, a32 v, morder mo);
265SANITIZER_INTERFACE_ATTRIBUTE
266a64 __tsan_atomic64_exchange(volatile a64 *a, a64 v, morder mo);
267#if __TSAN_HAS_INT128
268SANITIZER_INTERFACE_ATTRIBUTE
269a128 __tsan_atomic128_exchange(volatile a128 *a, a128 v, morder mo);
270#endif
271
272SANITIZER_INTERFACE_ATTRIBUTE
273a8 __tsan_atomic8_fetch_add(volatile a8 *a, a8 v, morder mo);
274SANITIZER_INTERFACE_ATTRIBUTE
275a16 __tsan_atomic16_fetch_add(volatile a16 *a, a16 v, morder mo);
276SANITIZER_INTERFACE_ATTRIBUTE
277a32 __tsan_atomic32_fetch_add(volatile a32 *a, a32 v, morder mo);
278SANITIZER_INTERFACE_ATTRIBUTE
279a64 __tsan_atomic64_fetch_add(volatile a64 *a, a64 v, morder mo);
280#if __TSAN_HAS_INT128
281SANITIZER_INTERFACE_ATTRIBUTE
282a128 __tsan_atomic128_fetch_add(volatile a128 *a, a128 v, morder mo);
283#endif
284
285SANITIZER_INTERFACE_ATTRIBUTE
286a8 __tsan_atomic8_fetch_sub(volatile a8 *a, a8 v, morder mo);
287SANITIZER_INTERFACE_ATTRIBUTE
288a16 __tsan_atomic16_fetch_sub(volatile a16 *a, a16 v, morder mo);
289SANITIZER_INTERFACE_ATTRIBUTE
290a32 __tsan_atomic32_fetch_sub(volatile a32 *a, a32 v, morder mo);
291SANITIZER_INTERFACE_ATTRIBUTE
292a64 __tsan_atomic64_fetch_sub(volatile a64 *a, a64 v, morder mo);
293#if __TSAN_HAS_INT128
294SANITIZER_INTERFACE_ATTRIBUTE
295a128 __tsan_atomic128_fetch_sub(volatile a128 *a, a128 v, morder mo);
296#endif
297
298SANITIZER_INTERFACE_ATTRIBUTE
299a8 __tsan_atomic8_fetch_and(volatile a8 *a, a8 v, morder mo);
300SANITIZER_INTERFACE_ATTRIBUTE
301a16 __tsan_atomic16_fetch_and(volatile a16 *a, a16 v, morder mo);
302SANITIZER_INTERFACE_ATTRIBUTE
303a32 __tsan_atomic32_fetch_and(volatile a32 *a, a32 v, morder mo);
304SANITIZER_INTERFACE_ATTRIBUTE
305a64 __tsan_atomic64_fetch_and(volatile a64 *a, a64 v, morder mo);
306#if __TSAN_HAS_INT128
307SANITIZER_INTERFACE_ATTRIBUTE
308a128 __tsan_atomic128_fetch_and(volatile a128 *a, a128 v, morder mo);
309#endif
310
311SANITIZER_INTERFACE_ATTRIBUTE
312a8 __tsan_atomic8_fetch_or(volatile a8 *a, a8 v, morder mo);
313SANITIZER_INTERFACE_ATTRIBUTE
314a16 __tsan_atomic16_fetch_or(volatile a16 *a, a16 v, morder mo);
315SANITIZER_INTERFACE_ATTRIBUTE
316a32 __tsan_atomic32_fetch_or(volatile a32 *a, a32 v, morder mo);
317SANITIZER_INTERFACE_ATTRIBUTE
318a64 __tsan_atomic64_fetch_or(volatile a64 *a, a64 v, morder mo);
319#if __TSAN_HAS_INT128
320SANITIZER_INTERFACE_ATTRIBUTE
321a128 __tsan_atomic128_fetch_or(volatile a128 *a, a128 v, morder mo);
322#endif
323
324SANITIZER_INTERFACE_ATTRIBUTE
325a8 __tsan_atomic8_fetch_xor(volatile a8 *a, a8 v, morder mo);
326SANITIZER_INTERFACE_ATTRIBUTE
327a16 __tsan_atomic16_fetch_xor(volatile a16 *a, a16 v, morder mo);
328SANITIZER_INTERFACE_ATTRIBUTE
329a32 __tsan_atomic32_fetch_xor(volatile a32 *a, a32 v, morder mo);
330SANITIZER_INTERFACE_ATTRIBUTE
331a64 __tsan_atomic64_fetch_xor(volatile a64 *a, a64 v, morder mo);
332#if __TSAN_HAS_INT128
333SANITIZER_INTERFACE_ATTRIBUTE
334a128 __tsan_atomic128_fetch_xor(volatile a128 *a, a128 v, morder mo);
335#endif
336
337SANITIZER_INTERFACE_ATTRIBUTE
338a8 __tsan_atomic8_fetch_nand(volatile a8 *a, a8 v, morder mo);
339SANITIZER_INTERFACE_ATTRIBUTE
340a16 __tsan_atomic16_fetch_nand(volatile a16 *a, a16 v, morder mo);
341SANITIZER_INTERFACE_ATTRIBUTE
342a32 __tsan_atomic32_fetch_nand(volatile a32 *a, a32 v, morder mo);
343SANITIZER_INTERFACE_ATTRIBUTE
344a64 __tsan_atomic64_fetch_nand(volatile a64 *a, a64 v, morder mo);
345#if __TSAN_HAS_INT128
346SANITIZER_INTERFACE_ATTRIBUTE
347a128 __tsan_atomic128_fetch_nand(volatile a128 *a, a128 v, morder mo);
348#endif
349
350SANITIZER_INTERFACE_ATTRIBUTE
351int __tsan_atomic8_compare_exchange_strong(volatile a8 *a, a8 *c, a8 v,
352 morder mo, morder fmo);
353SANITIZER_INTERFACE_ATTRIBUTE
354int __tsan_atomic16_compare_exchange_strong(volatile a16 *a, a16 *c, a16 v,
355 morder mo, morder fmo);
356SANITIZER_INTERFACE_ATTRIBUTE
357int __tsan_atomic32_compare_exchange_strong(volatile a32 *a, a32 *c, a32 v,
358 morder mo, morder fmo);
359SANITIZER_INTERFACE_ATTRIBUTE
360int __tsan_atomic64_compare_exchange_strong(volatile a64 *a, a64 *c, a64 v,
361 morder mo, morder fmo);
362#if __TSAN_HAS_INT128
363SANITIZER_INTERFACE_ATTRIBUTE
364int __tsan_atomic128_compare_exchange_strong(volatile a128 *a, a128 *c, a128 v,
365 morder mo, morder fmo);
366#endif
367
368SANITIZER_INTERFACE_ATTRIBUTE
369int __tsan_atomic8_compare_exchange_weak(volatile a8 *a, a8 *c, a8 v, morder mo,
370 morder fmo);
371SANITIZER_INTERFACE_ATTRIBUTE
372int __tsan_atomic16_compare_exchange_weak(volatile a16 *a, a16 *c, a16 v,
373 morder mo, morder fmo);
374SANITIZER_INTERFACE_ATTRIBUTE
375int __tsan_atomic32_compare_exchange_weak(volatile a32 *a, a32 *c, a32 v,
376 morder mo, morder fmo);
377SANITIZER_INTERFACE_ATTRIBUTE
378int __tsan_atomic64_compare_exchange_weak(volatile a64 *a, a64 *c, a64 v,
379 morder mo, morder fmo);
380#if __TSAN_HAS_INT128
381SANITIZER_INTERFACE_ATTRIBUTE
382int __tsan_atomic128_compare_exchange_weak(volatile a128 *a, a128 *c, a128 v,
383 morder mo, morder fmo);
384#endif
385
386SANITIZER_INTERFACE_ATTRIBUTE
387a8 __tsan_atomic8_compare_exchange_val(volatile a8 *a, a8 c, a8 v, morder mo,
388 morder fmo);
389SANITIZER_INTERFACE_ATTRIBUTE
390a16 __tsan_atomic16_compare_exchange_val(volatile a16 *a, a16 c, a16 v,
391 morder mo, morder fmo);
392SANITIZER_INTERFACE_ATTRIBUTE
393a32 __tsan_atomic32_compare_exchange_val(volatile a32 *a, a32 c, a32 v,
394 morder mo, morder fmo);
395SANITIZER_INTERFACE_ATTRIBUTE
396a64 __tsan_atomic64_compare_exchange_val(volatile a64 *a, a64 c, a64 v,
397 morder mo, morder fmo);
398#if __TSAN_HAS_INT128
399SANITIZER_INTERFACE_ATTRIBUTE
400a128 __tsan_atomic128_compare_exchange_val(volatile a128 *a, a128 c, a128 v,
401 morder mo, morder fmo);
402#endif
403
404SANITIZER_INTERFACE_ATTRIBUTE
405void __tsan_atomic_thread_fence(morder mo);
406SANITIZER_INTERFACE_ATTRIBUTE
407void __tsan_atomic_signal_fence(morder mo);
408
409SANITIZER_INTERFACE_ATTRIBUTE
410void __tsan_go_atomic32_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
411SANITIZER_INTERFACE_ATTRIBUTE
412void __tsan_go_atomic64_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
413SANITIZER_INTERFACE_ATTRIBUTE
414void __tsan_go_atomic32_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
415SANITIZER_INTERFACE_ATTRIBUTE
416void __tsan_go_atomic64_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
417SANITIZER_INTERFACE_ATTRIBUTE
418void __tsan_go_atomic32_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
419SANITIZER_INTERFACE_ATTRIBUTE
420void __tsan_go_atomic64_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
421SANITIZER_INTERFACE_ATTRIBUTE
422void __tsan_go_atomic32_fetch_and(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
423SANITIZER_INTERFACE_ATTRIBUTE
424void __tsan_go_atomic64_fetch_and(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
425SANITIZER_INTERFACE_ATTRIBUTE
426void __tsan_go_atomic32_fetch_or(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
427SANITIZER_INTERFACE_ATTRIBUTE
428void __tsan_go_atomic64_fetch_or(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
429SANITIZER_INTERFACE_ATTRIBUTE
430void __tsan_go_atomic32_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
431SANITIZER_INTERFACE_ATTRIBUTE
432void __tsan_go_atomic64_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
433SANITIZER_INTERFACE_ATTRIBUTE
434void __tsan_go_atomic32_compare_exchange(ThreadState *thr, uptr cpc, uptr pc,
435 u8 *a);
436SANITIZER_INTERFACE_ATTRIBUTE
437void __tsan_go_atomic64_compare_exchange(ThreadState *thr, uptr cpc, uptr pc,
438 u8 *a);
439
440} // extern "C"
441
442} // namespace __tsan
443
444#endif // TSAN_INTERFACE_H
445

source code of compiler-rt/lib/tsan/rtl/tsan_interface.h