From 7239a6003f18270c17965470ea6ce7ed43f3aaf8 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 14 Mar 2013 19:01:00 +0000 Subject: [PATCH] Android uses cacheflush(long start, long end, long flags) for MIPS. Patch by Stephen Hines. llvm-svn: 177101 --- llvm/lib/Support/Unix/Memory.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index e00394ec6aa3..e9b26bdb80f2 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/lib/Support/Unix/Memory.inc @@ -332,7 +332,16 @@ void Memory::InvalidateInstructionCache(const void *Addr, __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