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