summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-06-24 12:26:49 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-06-24 12:26:49 +0000
commitcf635fad02c1b861708756e34394a050a24e1cc1 (patch)
treed51233606d74bd573cd67c6b267190da49669ef4 /llvm/lib/Support
parent4dc8a78b04a66a73e515cf76271b946a5580f012 (diff)
downloadbcm5719-llvm-cf635fad02c1b861708756e34394a050a24e1cc1.tar.gz
bcm5719-llvm-cf635fad02c1b861708756e34394a050a24e1cc1.zip
[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 <Duane.Sand@imgtec.com> llvm-svn: 211588
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Unix/Memory.inc12
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index c9d89a82474..cae39d4edc1 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/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<const char *>(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)
- // 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
cacheflush(const_cast<char *>(Start), Len, BCACHE);
-# endif
# endif
#endif // end apple
OpenPOWER on IntegriCloud