aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt/lib/tysan/tysan_platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/tysan/tysan_platform.h')
-rw-r--r--compiler-rt/lib/tysan/tysan_platform.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler-rt/lib/tysan/tysan_platform.h b/compiler-rt/lib/tysan/tysan_platform.h
index f013928..19f77f0 100644
--- a/compiler-rt/lib/tysan/tysan_platform.h
+++ b/compiler-rt/lib/tysan/tysan_platform.h
@@ -21,24 +21,28 @@ struct Mapping {
static const uptr kShadowAddr = 0x010000000000ull;
static const uptr kAppAddr = 0x550000000000ull;
static const uptr kAppMemMsk = ~0x780000000000ull;
+ static const uptr kPtrShift = 3;
};
#elif defined(__aarch64__)
struct Mapping39 {
static const uptr kShadowAddr = 0x0800000000ull;
static const uptr kAppAddr = 0x5500000000ull;
static const uptr kAppMemMsk = ~0x7800000000ull;
+ static const uptr kPtrShift = 3;
};
struct Mapping42 {
static const uptr kShadowAddr = 0x10000000000ull;
static const uptr kAppAddr = 0x2aa00000000ull;
static const uptr kAppMemMsk = ~0x3c000000000ull;
+ static const uptr kPtrShift = 3;
};
struct Mapping48 {
static const uptr kShadowAddr = 0x0002000000000ull;
static const uptr kAppAddr = 0x0aaaa00000000ull;
static const uptr kAppMemMsk = ~0x0fff800000000ull;
+ static const uptr kPtrShift = 3;
};
#define TYSAN_RUNTIME_VMA 1
#else
@@ -49,7 +53,12 @@ struct Mapping48 {
extern int vmaSize;
#endif
-enum MappingType { MAPPING_SHADOW_ADDR, MAPPING_APP_ADDR, MAPPING_APP_MASK };
+enum MappingType {
+ MAPPING_SHADOW_ADDR,
+ MAPPING_APP_ADDR,
+ MAPPING_APP_MASK,
+ MAPPING_PTR_SHIFT
+};
template <typename Mapping, int Type> uptr MappingImpl(void) {
switch (Type) {
@@ -59,6 +68,8 @@ template <typename Mapping, int Type> uptr MappingImpl(void) {
return Mapping::kAppAddr;
case MAPPING_APP_MASK:
return Mapping::kAppMemMsk;
+ case MAPPING_PTR_SHIFT:
+ return Mapping::kPtrShift;
}
}
@@ -88,6 +99,9 @@ uptr AppAddr() { return MappingArchImpl<MAPPING_APP_ADDR>(); }
ALWAYS_INLINE
uptr AppMask() { return MappingArchImpl<MAPPING_APP_MASK>(); }
+ALWAYS_INLINE
+uptr PtrShift() { return MappingArchImpl<MAPPING_PTR_SHIFT>(); }
+
} // namespace __tysan
#endif