aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/Memory.inc')
-rw-r--r--lib/Support/Unix/Memory.inc10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc
index 2686ba6..e9b26bd 100644
--- a/lib/Support/Unix/Memory.inc
+++ b/lib/Support/Unix/Memory.inc
@@ -331,11 +331,15 @@ void Memory::InvalidateInstructionCache(const void *Addr,
const char *End = Start + Len;
__clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
# elif defined(__mips__)
+ const char *Start = static_cast<const char *>(Addr);
# if defined(ANDROID)
- // Android uses cacheflush(long, long, long) instead.
- cacheflush(reinterpret_cast<long>(Addr), Len, BCACHE);
+ // 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<long>(const_cast<char *>(Start));
+ long LEnd = reinterpret_cast<long>(const_cast<char *>(End));
+ cacheflush(LStart, LEnd, BCACHE);
# else
- const char *Start = static_cast<const char *>(Addr);
cacheflush(const_cast<char *>(Start), Len, BCACHE);
# endif
# endif