diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-19 21:42:33 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-19 21:42:33 +0000 |
| commit | de130188740c5acdc98dc5902af66ef8b983e3a8 (patch) | |
| tree | d11622c2adab6d9a115c21b593fbfb2383d07afd /compiler-rt/lib/sanitizer_common | |
| parent | be6dd818fbf1305c895038904396d20761d3f98c (diff) | |
| download | bcm5719-llvm-de130188740c5acdc98dc5902af66ef8b983e3a8.tar.gz bcm5719-llvm-de130188740c5acdc98dc5902af66ef8b983e3a8.zip | |
[MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).
Reviewed at http://reviews.llvm.org/D5906
llvm-svn: 222388
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
4 files changed, 12 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h index abede8b382b..6f8cd30bf4d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -94,6 +94,8 @@ // but will consume more memory for TwoLevelByteMap. #if defined(__aarch64__) # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 39) +#elif defined(__mips__) +# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 40) #else # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47) #endif diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc index 527c24ee75b..eb2497b4d94 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc @@ -89,7 +89,7 @@ uptr GetMaxVirtualAddress() { # elif defined(__aarch64__) return (1ULL << 39) - 1; # elif defined(__mips64) - return (1ULL << 40) - 1; + return (1ULL << 40) - 1; // 0x000000ffffffffffUL; # else return (1ULL << 47) - 1; // 0x00007fffffffffffUL; # endif diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc index 04acd5c8752..cf061fb8c73 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc @@ -32,6 +32,14 @@ uptr StackTrace::GetPreviousInstructionPc(uptr pc) { #endif } +uptr StackTrace::GetNextInstructionPc(uptr pc) { +#if defined(__mips__) + return pc + 8; +#else + return pc + 1; +#endif +} + uptr StackTrace::GetCurrentPc() { return GET_CALLER_PC(); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h index 6279e1557d1..e755c052cb7 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h @@ -58,6 +58,7 @@ struct StackTrace { static uptr GetCurrentPc(); static uptr GetPreviousInstructionPc(uptr pc); + static uptr GetNextInstructionPc(uptr pc); typedef bool (*SymbolizeCallback)(const void *pc, char *out_buffer, int out_size); }; |

