diff options
author | Mohit K. Bhakkad <mohit.bhakkad@imgtec.com> | 2015-02-20 06:42:41 +0000 |
---|---|---|
committer | Mohit K. Bhakkad <mohit.bhakkad@imgtec.com> | 2015-02-20 06:42:41 +0000 |
commit | a61eea78ae7717fe144d386a02b110f7fbe413d3 (patch) | |
tree | 30861cb19cbbcdfa1e95257e971444fe6cd6dc37 /lib/tsan/rtl/tsan_rtl.h | |
parent | 4b94e35618ef074ec689b3fa0c8e96b137d6e946 (diff) |
[TSan][MIPS] Adding support for MIPS64
Patch by Sagar Thakur
Reviewers: dvyukov, samsonov, petarj, kcc, dsanders.
Subscribers: mohit.bhakkad, Anand.Takale, llvm-commits.
Differential Revision: http://reviews.llvm.org/D6291
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_rtl.h')
-rw-r--r-- | lib/tsan/rtl/tsan_rtl.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl.h b/lib/tsan/rtl/tsan_rtl.h index 570c8d6d4..7a60e5c55 100644 --- a/lib/tsan/rtl/tsan_rtl.h +++ b/lib/tsan/rtl/tsan_rtl.h @@ -54,8 +54,21 @@ namespace __tsan { #ifndef SANITIZER_GO struct MapUnmapCallback; +#ifdef __mips64 +static const uptr kAllocatorSpace = 0; +static const uptr kAllocatorSize = SANITIZER_MMAP_RANGE_SIZE; +static const uptr kAllocatorRegionSizeLog = 20; +static const uptr kAllocatorNumRegions = + kAllocatorSize >> kAllocatorRegionSizeLog; +typedef TwoLevelByteMap<(kAllocatorNumRegions >> 12), 1 << 12, + MapUnmapCallback> ByteMap; +typedef SizeClassAllocator32<kAllocatorSpace, kAllocatorSize, 0, + CompactSizeClassMap, kAllocatorRegionSizeLog, ByteMap, + MapUnmapCallback> PrimaryAllocator; +#else typedef SizeClassAllocator64<kHeapMemBeg, kHeapMemEnd - kHeapMemBeg, 0, DefaultSizeClassMap, MapUnmapCallback> PrimaryAllocator; +#endif typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache; typedef LargeMmapAllocator<MapUnmapCallback> SecondaryAllocator; typedef CombinedAllocator<PrimaryAllocator, AllocatorCache, @@ -738,6 +751,16 @@ void ALWAYS_INLINE TraceAddEvent(ThreadState *thr, FastState fs, *evp = ev; } +#ifndef SANITIZER_GO +uptr ALWAYS_INLINE HeapEnd() { +#if SANITIZER_CAN_USE_ALLOCATOR64 + return kHeapMemEnd + PrimaryAllocator::AdditionalSize(); +#else + return kHeapMemEnd; +#endif +} +#endif + } // namespace __tsan #endif // TSAN_RTL_H |