2012-05-10 21:48:04 +08:00
|
|
|
//===-- tsan_platform.h -----------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of ThreadSanitizer (TSan), a race detector.
|
|
|
|
//
|
|
|
|
// Platform-specific code.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
#ifndef TSAN_PLATFORM_H
|
|
|
|
#define TSAN_PLATFORM_H
|
|
|
|
|
|
|
|
#if !defined(__LP64__) && !defined(_WIN64)
|
|
|
|
# error "Only 64-bit is supported"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "tsan_defs.h"
|
|
|
|
#include "tsan_trace.h"
|
|
|
|
|
|
|
|
namespace __tsan {
|
|
|
|
|
2014-12-09 09:31:14 +08:00
|
|
|
#if !defined(SANITIZER_GO)
|
2014-10-25 01:07:29 +08:00
|
|
|
|
2015-02-20 14:42:41 +08:00
|
|
|
#if defined(__x86_64__)
|
2012-11-28 15:44:26 +08:00
|
|
|
/*
|
2015-02-20 14:42:41 +08:00
|
|
|
C/C++ on linux/x86_64 and freebsd/x86_64
|
2014-10-25 01:07:29 +08:00
|
|
|
0000 0000 1000 - 0100 0000 0000: main binary and/or MAP_32BIT mappings
|
|
|
|
0100 0000 0000 - 0200 0000 0000: -
|
|
|
|
0200 0000 0000 - 1000 0000 0000: shadow
|
|
|
|
1000 0000 0000 - 3000 0000 0000: -
|
2014-05-29 21:50:54 +08:00
|
|
|
3000 0000 0000 - 4000 0000 0000: metainfo (memory blocks and sync objects)
|
2014-10-25 01:07:29 +08:00
|
|
|
4000 0000 0000 - 6000 0000 0000: -
|
2012-11-28 18:35:31 +08:00
|
|
|
6000 0000 0000 - 6200 0000 0000: traces
|
|
|
|
6200 0000 0000 - 7d00 0000 0000: -
|
2012-11-28 15:44:26 +08:00
|
|
|
7d00 0000 0000 - 7e00 0000 0000: heap
|
2014-10-25 01:07:29 +08:00
|
|
|
7e00 0000 0000 - 7e80 0000 0000: -
|
|
|
|
7e80 0000 0000 - 8000 0000 0000: modules and main thread stack
|
|
|
|
*/
|
|
|
|
const uptr kMetaShadowBeg = 0x300000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x400000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x600000000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x620000000000ull;
|
|
|
|
const uptr kShadowBeg = 0x020000000000ull;
|
|
|
|
const uptr kShadowEnd = 0x100000000000ull;
|
|
|
|
const uptr kHeapMemBeg = 0x7d0000000000ull;
|
|
|
|
const uptr kHeapMemEnd = 0x7e0000000000ull;
|
|
|
|
const uptr kLoAppMemBeg = 0x000000001000ull;
|
|
|
|
const uptr kLoAppMemEnd = 0x010000000000ull;
|
|
|
|
const uptr kHiAppMemBeg = 0x7e8000000000ull;
|
|
|
|
const uptr kHiAppMemEnd = 0x800000000000ull;
|
|
|
|
const uptr kAppMemMsk = 0x7c0000000000ull;
|
|
|
|
const uptr kAppMemXor = 0x020000000000ull;
|
2015-02-20 14:42:41 +08:00
|
|
|
const uptr kVdsoBeg = 0xf000000000000000ull;
|
|
|
|
#elif defined(__mips64)
|
|
|
|
/*
|
|
|
|
C/C++ on linux/mips64
|
|
|
|
0100 0000 00 - 0200 0000 00: main binary
|
|
|
|
0200 0000 00 - 1400 0000 00: -
|
|
|
|
1400 0000 00 - 2400 0000 00: shadow
|
|
|
|
2400 0000 00 - 3000 0000 00: -
|
|
|
|
3000 0000 00 - 4000 0000 00: metainfo (memory blocks and sync objects)
|
|
|
|
4000 0000 00 - 6000 0000 00: -
|
|
|
|
6000 0000 00 - 6200 0000 00: traces
|
|
|
|
6200 0000 00 - fe00 0000 00: -
|
|
|
|
fe00 0000 00 - ff00 0000 00: heap
|
|
|
|
ff00 0000 00 - ff80 0000 00: -
|
|
|
|
ff80 0000 00 - ffff ffff ff: modules and main thread stack
|
|
|
|
*/
|
|
|
|
const uptr kMetaShadowBeg = 0x3000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x4000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x6000000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x6200000000ull;
|
|
|
|
const uptr kShadowBeg = 0x1400000000ull;
|
|
|
|
const uptr kShadowEnd = 0x2400000000ull;
|
|
|
|
const uptr kHeapMemBeg = 0xfe00000000ull;
|
|
|
|
const uptr kHeapMemEnd = 0xff00000000ull;
|
|
|
|
const uptr kLoAppMemBeg = 0x0100000000ull;
|
|
|
|
const uptr kLoAppMemEnd = 0x0200000000ull;
|
|
|
|
const uptr kHiAppMemBeg = 0xff80000000ull;
|
|
|
|
const uptr kHiAppMemEnd = 0xffffffffffull;
|
|
|
|
const uptr kAppMemMsk = 0xfc00000000ull;
|
|
|
|
const uptr kAppMemXor = 0x0400000000ull;
|
|
|
|
const uptr kVdsoBeg = 0xfffff00000ull;
|
2015-08-05 23:17:59 +08:00
|
|
|
#elif defined(__aarch64__)
|
2015-08-29 04:40:50 +08:00
|
|
|
# if SANITIZER_AARCH64_VMA == 39
|
2015-08-05 23:17:59 +08:00
|
|
|
/*
|
|
|
|
C/C++ on linux/aarch64 (39-bit VMA)
|
|
|
|
0000 4000 00 - 0200 0000 00: main binary
|
|
|
|
2000 0000 00 - 4000 0000 00: shadow memory
|
|
|
|
4000 0000 00 - 5000 0000 00: metainfo
|
|
|
|
5000 0000 00 - 6000 0000 00: -
|
|
|
|
6000 0000 00 - 6200 0000 00: traces
|
|
|
|
6200 0000 00 - 7d00 0000 00: -
|
|
|
|
7d00 0000 00 - 7e00 0000 00: heap
|
|
|
|
7e00 0000 00 - 7fff ffff ff: modules and main thread stack
|
|
|
|
*/
|
|
|
|
const uptr kLoAppMemBeg = 0x0000400000ull;
|
|
|
|
const uptr kLoAppMemEnd = 0x0200000000ull;
|
|
|
|
const uptr kShadowBeg = 0x2000000000ull;
|
|
|
|
const uptr kShadowEnd = 0x4000000000ull;
|
|
|
|
const uptr kMetaShadowBeg = 0x4000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x5000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x6000000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x6200000000ull;
|
|
|
|
const uptr kHeapMemBeg = 0x7d00000000ull;
|
|
|
|
const uptr kHeapMemEnd = 0x7e00000000ull;
|
|
|
|
const uptr kHiAppMemBeg = 0x7e00000000ull;
|
|
|
|
const uptr kHiAppMemEnd = 0x7fffffffffull;
|
|
|
|
const uptr kAppMemMsk = 0x7800000000ull;
|
|
|
|
const uptr kAppMemXor = 0x0800000000ull;
|
|
|
|
const uptr kVdsoBeg = 0x7f00000000ull;
|
2015-08-29 04:40:50 +08:00
|
|
|
# elif SANITIZER_AARCH64_VMA == 42
|
|
|
|
/*
|
|
|
|
C/C++ on linux/aarch64 (42-bit VMA)
|
|
|
|
00000 4000 00 - 01000 0000 00: main binary
|
|
|
|
01000 0000 00 - 10000 0000 00: -
|
|
|
|
10000 0000 00 - 20000 0000 00: shadow memory
|
|
|
|
20000 0000 00 - 26000 0000 00: -
|
|
|
|
26000 0000 00 - 28000 0000 00: metainfo
|
|
|
|
28000 0000 00 - 36200 0000 00: -
|
|
|
|
36200 0000 00 - 36240 0000 00: traces
|
|
|
|
36240 0000 00 - 3e000 0000 00: -
|
|
|
|
3e000 0000 00 - 3f000 0000 00: heap
|
|
|
|
3c000 0000 00 - 3ff00 0000 00: -
|
|
|
|
3ff00 0000 00 - 3ffff f000 00: modules and main thread stack
|
|
|
|
*/
|
|
|
|
const uptr kLoAppMemBeg = 0x00000400000ull;
|
|
|
|
const uptr kLoAppMemEnd = 0x01000000000ull;
|
|
|
|
const uptr kShadowBeg = 0x10000000000ull;
|
|
|
|
const uptr kShadowEnd = 0x20000000000ull;
|
|
|
|
const uptr kMetaShadowBeg = 0x26000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x28000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x36200000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x36400000000ull;
|
|
|
|
const uptr kHeapMemBeg = 0x3e000000000ull;
|
|
|
|
const uptr kHeapMemEnd = 0x3f000000000ull;
|
|
|
|
const uptr kHiAppMemBeg = 0x3ff00000000ull;
|
|
|
|
const uptr kHiAppMemEnd = 0x3fffff00000ull;
|
|
|
|
const uptr kAppMemMsk = 0x3c000000000ull;
|
|
|
|
const uptr kAppMemXor = 0x04000000000ull;
|
|
|
|
const uptr kVdsoBeg = 0x37f00000000ull;
|
|
|
|
# endif
|
2015-02-20 14:42:41 +08:00
|
|
|
#endif
|
2014-10-25 01:07:29 +08:00
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsAppMem(uptr mem) {
|
|
|
|
return (mem >= kHeapMemBeg && mem < kHeapMemEnd) ||
|
|
|
|
(mem >= kLoAppMemBeg && mem < kLoAppMemEnd) ||
|
|
|
|
(mem >= kHiAppMemBeg && mem < kHiAppMemEnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsShadowMem(uptr mem) {
|
|
|
|
return mem >= kShadowBeg && mem <= kShadowEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsMetaMem(uptr mem) {
|
|
|
|
return mem >= kMetaShadowBeg && mem <= kMetaShadowEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr MemToShadow(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
|
|
|
return (((x) & ~(kAppMemMsk | (kShadowCell - 1)))
|
|
|
|
^ kAppMemXor) * kShadowCnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
u32 *MemToMeta(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
|
|
|
return (u32*)(((((x) & ~(kAppMemMsk | (kMetaShadowCell - 1)))
|
|
|
|
^ kAppMemXor) / kMetaShadowCell * kMetaShadowSize) | kMetaShadowBeg);
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr ShadowToMem(uptr s) {
|
|
|
|
CHECK(IsShadowMem(s));
|
|
|
|
if (s >= MemToShadow(kLoAppMemBeg) && s <= MemToShadow(kLoAppMemEnd - 1))
|
|
|
|
return (s / kShadowCnt) ^ kAppMemXor;
|
|
|
|
else
|
|
|
|
return ((s / kShadowCnt) ^ kAppMemXor) | kAppMemMsk;
|
|
|
|
}
|
|
|
|
|
|
|
|
static USED uptr UserRegions[] = {
|
|
|
|
kLoAppMemBeg, kLoAppMemEnd,
|
|
|
|
kHiAppMemBeg, kHiAppMemEnd,
|
|
|
|
kHeapMemBeg, kHeapMemEnd,
|
|
|
|
};
|
|
|
|
|
2014-12-09 09:31:14 +08:00
|
|
|
#elif defined(SANITIZER_GO) && !SANITIZER_WINDOWS
|
2014-10-25 01:07:29 +08:00
|
|
|
|
|
|
|
/* Go on linux, darwin and freebsd
|
|
|
|
0000 0000 1000 - 0000 1000 0000: executable
|
|
|
|
0000 1000 0000 - 00c0 0000 0000: -
|
2013-04-23 23:24:26 +08:00
|
|
|
00c0 0000 0000 - 00e0 0000 0000: heap
|
2014-10-25 01:07:29 +08:00
|
|
|
00e0 0000 0000 - 2000 0000 0000: -
|
|
|
|
2000 0000 0000 - 2380 0000 0000: shadow
|
|
|
|
2380 0000 0000 - 3000 0000 0000: -
|
2014-05-29 21:50:54 +08:00
|
|
|
3000 0000 0000 - 4000 0000 0000: metainfo (memory blocks and sync objects)
|
|
|
|
4000 0000 0000 - 6000 0000 0000: -
|
2012-11-28 18:35:31 +08:00
|
|
|
6000 0000 0000 - 6200 0000 0000: traces
|
2014-10-25 01:07:29 +08:00
|
|
|
6200 0000 0000 - 8000 0000 0000: -
|
|
|
|
*/
|
|
|
|
|
|
|
|
const uptr kMetaShadowBeg = 0x300000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x400000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x600000000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x620000000000ull;
|
|
|
|
const uptr kShadowBeg = 0x200000000000ull;
|
|
|
|
const uptr kShadowEnd = 0x238000000000ull;
|
|
|
|
const uptr kAppMemBeg = 0x000000001000ull;
|
|
|
|
const uptr kAppMemEnd = 0x00e000000000ull;
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsAppMem(uptr mem) {
|
|
|
|
return mem >= kAppMemBeg && mem < kAppMemEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsShadowMem(uptr mem) {
|
|
|
|
return mem >= kShadowBeg && mem <= kShadowEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsMetaMem(uptr mem) {
|
|
|
|
return mem >= kMetaShadowBeg && mem <= kMetaShadowEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr MemToShadow(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
|
|
|
return ((x & ~(kShadowCell - 1)) * kShadowCnt) | kShadowBeg;
|
|
|
|
}
|
2012-11-28 15:44:26 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
u32 *MemToMeta(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
|
|
|
return (u32*)(((x & ~(kMetaShadowCell - 1)) / \
|
|
|
|
kMetaShadowCell * kMetaShadowSize) | kMetaShadowBeg);
|
|
|
|
}
|
|
|
|
|
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr ShadowToMem(uptr s) {
|
|
|
|
CHECK(IsShadowMem(s));
|
|
|
|
return (s & ~kShadowBeg) / kShadowCnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
static USED uptr UserRegions[] = {
|
|
|
|
kAppMemBeg, kAppMemEnd,
|
|
|
|
};
|
|
|
|
|
2014-12-09 09:31:14 +08:00
|
|
|
#elif defined(SANITIZER_GO) && SANITIZER_WINDOWS
|
2014-10-25 01:07:29 +08:00
|
|
|
|
|
|
|
/* Go on windows
|
|
|
|
0000 0000 1000 - 0000 1000 0000: executable
|
2012-11-28 15:44:26 +08:00
|
|
|
0000 1000 0000 - 00f8 0000 0000: -
|
2013-04-23 23:24:26 +08:00
|
|
|
00c0 0000 0000 - 00e0 0000 0000: heap
|
|
|
|
00e0 0000 0000 - 0100 0000 0000: -
|
2015-02-16 21:52:04 +08:00
|
|
|
0100 0000 0000 - 0500 0000 0000: shadow
|
|
|
|
0500 0000 0000 - 0560 0000 0000: -
|
2012-11-28 18:35:31 +08:00
|
|
|
0560 0000 0000 - 0760 0000 0000: traces
|
2014-05-29 21:50:54 +08:00
|
|
|
0760 0000 0000 - 07d0 0000 0000: metainfo (memory blocks and sync objects)
|
2014-10-25 01:07:29 +08:00
|
|
|
07d0 0000 0000 - 8000 0000 0000: -
|
2012-11-28 15:44:26 +08:00
|
|
|
*/
|
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
const uptr kMetaShadowBeg = 0x076000000000ull;
|
|
|
|
const uptr kMetaShadowEnd = 0x07d000000000ull;
|
|
|
|
const uptr kTraceMemBeg = 0x056000000000ull;
|
|
|
|
const uptr kTraceMemEnd = 0x076000000000ull;
|
|
|
|
const uptr kShadowBeg = 0x010000000000ull;
|
2015-02-16 21:52:04 +08:00
|
|
|
const uptr kShadowEnd = 0x050000000000ull;
|
2014-10-25 01:07:29 +08:00
|
|
|
const uptr kAppMemBeg = 0x000000001000ull;
|
|
|
|
const uptr kAppMemEnd = 0x00e000000000ull;
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsAppMem(uptr mem) {
|
|
|
|
return mem >= kAppMemBeg && mem < kAppMemEnd;
|
|
|
|
}
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsShadowMem(uptr mem) {
|
|
|
|
return mem >= kShadowBeg && mem <= kShadowEnd;
|
|
|
|
}
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
bool IsMetaMem(uptr mem) {
|
|
|
|
return mem >= kMetaShadowBeg && mem <= kMetaShadowEnd;
|
|
|
|
}
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr MemToShadow(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
2015-02-16 21:52:04 +08:00
|
|
|
return ((x & ~(kShadowCell - 1)) * kShadowCnt) + kShadowBeg;
|
2012-05-10 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
u32 *MemToMeta(uptr x) {
|
|
|
|
DCHECK(IsAppMem(x));
|
|
|
|
return (u32*)(((x & ~(kMetaShadowCell - 1)) / \
|
2015-02-16 21:52:04 +08:00
|
|
|
kMetaShadowCell * kMetaShadowSize) | kMetaShadowBeg);
|
2012-05-10 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
ALWAYS_INLINE
|
|
|
|
uptr ShadowToMem(uptr s) {
|
|
|
|
CHECK(IsShadowMem(s));
|
|
|
|
// FIXME(dvyukov): this is most likely wrong as the mapping is not bijection.
|
2015-02-16 21:52:04 +08:00
|
|
|
return (s - kShadowBeg) / kShadowCnt;
|
2012-05-10 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
static USED uptr UserRegions[] = {
|
|
|
|
kAppMemBeg, kAppMemEnd,
|
|
|
|
};
|
2012-05-22 19:33:03 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
#else
|
|
|
|
# error "Unknown platform"
|
|
|
|
#endif
|
2013-10-16 23:35:12 +08:00
|
|
|
|
|
|
|
// The additional page is to catch shadow stack overflow as paging fault.
|
2014-02-05 19:37:20 +08:00
|
|
|
// Windows wants 64K alignment for mmaps.
|
|
|
|
const uptr kTotalTraceSize = (kTraceSize * sizeof(Event) + sizeof(Trace)
|
|
|
|
+ (64 << 10) + (64 << 10) - 1) & ~((64 << 10) - 1);
|
2013-10-16 23:35:12 +08:00
|
|
|
|
2013-03-29 02:52:40 +08:00
|
|
|
uptr ALWAYS_INLINE GetThreadTrace(int tid) {
|
2014-10-25 01:07:29 +08:00
|
|
|
uptr p = kTraceMemBeg + (uptr)tid * kTotalTraceSize;
|
|
|
|
DCHECK_LT(p, kTraceMemEnd);
|
2013-03-20 18:31:53 +08:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2013-03-29 02:52:40 +08:00
|
|
|
uptr ALWAYS_INLINE GetThreadTraceHeader(int tid) {
|
2014-10-25 01:07:29 +08:00
|
|
|
uptr p = kTraceMemBeg + (uptr)tid * kTotalTraceSize
|
2013-10-16 23:35:12 +08:00
|
|
|
+ kTraceSize * sizeof(Event);
|
2014-10-25 01:07:29 +08:00
|
|
|
DCHECK_LT(p, kTraceMemEnd);
|
2012-11-28 18:35:31 +08:00
|
|
|
return p;
|
|
|
|
}
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-10-25 01:07:29 +08:00
|
|
|
void InitializePlatform();
|
2015-11-04 19:39:40 +08:00
|
|
|
void CheckAndProtect();
|
|
|
|
void InitializeShadowMemoryPlatform();
|
2014-10-25 01:07:29 +08:00
|
|
|
void FlushShadowMemory();
|
|
|
|
void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive);
|
|
|
|
|
2012-09-08 02:08:02 +08:00
|
|
|
// Says whether the addr relates to a global var.
|
|
|
|
// Guesses with high probability, may yield both false positives and negatives.
|
|
|
|
bool IsGlobalVar(uptr addr);
|
2013-02-07 23:27:45 +08:00
|
|
|
int ExtractResolvFDs(void *state, int *fds, int nfd);
|
2013-11-28 17:09:42 +08:00
|
|
|
int ExtractRecvmsgFDs(void *msg, int *fds, int nfd);
|
2012-05-10 21:48:04 +08:00
|
|
|
|
2014-04-17 07:06:46 +08:00
|
|
|
int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m,
|
|
|
|
void *abstime), void *c, void *m, void *abstime,
|
|
|
|
void(*cleanup)(void *arg), void *arg);
|
|
|
|
|
2012-05-10 21:48:04 +08:00
|
|
|
} // namespace __tsan
|
|
|
|
|
2012-07-16 21:02:40 +08:00
|
|
|
#endif // TSAN_PLATFORM_H
|