tsan_interface.h 18 KB

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