OSDN Git Service

Android uses cacheflush(long, long, long) for MIPS.
authorkeunyoung <keunyoung@google.com>
Thu, 7 Mar 2013 20:50:38 +0000 (12:50 -0800)
committerStephen Hines <srhines@google.com>
Fri, 8 Mar 2013 00:08:20 +0000 (16:08 -0800)
Change-Id: Ia2902dd3521ff310e2261c8f627c95b3e7c9fdad

lib/Support/Unix/Memory.inc

index e00394e..2686ba6 100644 (file)
@@ -331,8 +331,13 @@ void Memory::InvalidateInstructionCache(const void *Addr,
   const char *End = Start + Len;
   __clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
 #  elif defined(__mips__)
+#    if defined(ANDROID)
+  // Android uses cacheflush(long, long, long) instead.
+  cacheflush(reinterpret_cast<long>(Addr), Len, BCACHE);
+#    else
   const char *Start = static_cast<const char *>(Addr);
   cacheflush(const_cast<char *>(Start), Len, BCACHE);
+#    endif
 #  endif
 
 #endif  // end apple