From 2523346594d27d262ede0e48b861214a313660cf Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Tue, 24 Jun 2014 12:26:49 +0000 Subject: [mips] Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache() MIPS64 Android bionic has removed cacheflush(). Use __clear_cache() instead for 32-bit and 64-bit MIPS Patch by Duane Sand git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211588 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Memory.inc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/Support') diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc index c9d89a8247..cae39d4edc 100644 --- a/lib/Support/Unix/Memory.inc +++ b/lib/Support/Unix/Memory.inc @@ -333,23 +333,15 @@ void Memory::InvalidateInstructionCache(const void *Addr, for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) asm volatile("icbi 0, %0" : : "r"(Line)); asm volatile("isync"); -# elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) +# elif (defined(__arm__) || defined(__aarch64__) || defined(__mips__)) && defined(__GNUC__) // FIXME: Can we safely always call this for __GNUC__ everywhere? + // Use compiler's builtin const char *Start = static_cast(Addr); const char *End = Start + Len; __clear_cache(const_cast(Start), const_cast(End)); # elif defined(__mips__) const char *Start = static_cast(Addr); -# if defined(ANDROID) - // The declaration of "cacheflush" in Android bionic: - // extern int cacheflush(long start, long end, long flags); - const char *End = Start + Len; - long LStart = reinterpret_cast(const_cast(Start)); - long LEnd = reinterpret_cast(const_cast(End)); - cacheflush(LStart, LEnd, BCACHE); -# else cacheflush(const_cast(Start), Len, BCACHE); -# endif # endif #endif // end apple -- cgit v1.2.3