From d4e27d7e93d697dd8d3be4ad43081478f120d70b Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Mon, 27 Apr 2015 10:20:08 +0000 Subject: [PATCH] Merging r227269: ------------------------------------------------------------------------ r227269 | petarj | 2015-01-27 23:30:18 +0000 (Tue, 27 Jan 2015) | 7 lines [mips] Use __clear_cache builtin instead of cacheflush() Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache(). Differential Revision: http://reviews.llvm.org/D7198 ------------------------------------------------------------------------ llvm-svn: 235858 --- llvm/lib/Support/Unix/Memory.inc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index 7ccde463459dd..c421ee84c2b72 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/lib/Support/Unix/Memory.inc @@ -333,23 +333,12 @@ 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? 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