summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2015-02-10 23:36:19 +0000
committerPetar Jovanovic <petar.jovanovic@imgtec.com>2015-02-10 23:36:19 +0000
commit08fc9e9158174f841b3e2360ff96fc9ca7c595ec (patch)
treed3ca2f606da03052b9da1640f0eb5ea7ac615f77
parenteb9472709817c853fcdd0e57622805f2757b4925 (diff)
downloadbcm5719-llvm-08fc9e9158174f841b3e2360ff96fc9ca7c595ec.tar.gz
bcm5719-llvm-08fc9e9158174f841b3e2360ff96fc9ca7c595ec.zip
[mips] Add __clear_cache() definition for non-Android systems
Make sure clear_cache() builtin has an appropriate definition for Linux. Call syscall(NR_cacheflush, ...). Differential Revision: http://reviews.llvm.org/D7205 llvm-svn: 228767
-rw-r--r--compiler-rt/lib/builtins/clear_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/lib/builtins/clear_cache.c b/compiler-rt/lib/builtins/clear_cache.c
index 61b1e9bbb5c..8dc0fb1c590 100644
--- a/compiler-rt/lib/builtins/clear_cache.c
+++ b/compiler-rt/lib/builtins/clear_cache.c
@@ -22,10 +22,10 @@
#include <machine/sysarch.h>
#endif
-#if defined(__ANDROID__) && defined(__mips__)
+#if defined(__mips__)
#include <sys/cachectl.h>
#include <sys/syscall.h>
- #ifdef __LP64__
+ #if defined(__ANDROID__) && defined(__LP64__)
/*
* clear_mips_cache - Invalidates instruction cache for Mips.
*/
@@ -109,10 +109,10 @@ void __clear_cache(void *start, void *end) {
#else
compilerrt_abort();
#endif
-#elif defined(__ANDROID__) && defined(__mips__)
+#elif defined(__mips__)
const uintptr_t start_int = (uintptr_t) start;
const uintptr_t end_int = (uintptr_t) end;
- #ifdef __LP64__
+ #if defined(__ANDROID__) && defined(__LP64__)
// Call synci implementation for short address range.
const uintptr_t address_range_limit = 256;
if ((end_int - start_int) <= address_range_limit) {
OpenPOWER on IntegriCloud