Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: runtime/vm/cpu_arm64.cc

Issue 2987873002: [fuchsia, arm64] Use mx_cache_flush instead of removed __clear_cache. (Closed)
Patch Set: . Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cpu_arm64.cc
diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc
index 0c089aeff0960e05640e42fb8f46da06fb9f20a4..14142ecfd4b65eb2ec362c76ce963fb784793236 100644
--- a/runtime/vm/cpu_arm64.cc
+++ b/runtime/vm/cpu_arm64.cc
@@ -13,9 +13,11 @@
#if !defined(USING_SIMULATOR)
#if !defined(HOST_OS_FUCHSIA)
-#include <sys/syscall.h> /* NOLINT */
+#include <sys/syscall.h>
+#else
+#include <magenta/syscalls.h>
#endif
-#include <unistd.h> /* NOLINT */
+#include <unistd.h>
#endif
namespace dart {
@@ -34,12 +36,15 @@ void CPU::FlushICache(uword start, uword size) {
// ARM recommends using the gcc intrinsic __clear_cache on Linux and Android.
// blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) || \
- defined(HOST_OS_LINUX)
+#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
extern void __clear_cache(char*, char*);
char* beg = reinterpret_cast<char*>(start);
char* end = reinterpret_cast<char*>(start + size);
::__clear_cache(beg, end);
+#elif defined(HOST_OS_FUCHSIA)
+ mx_status_t result = mx_cache_flush(reinterpret_cast<const void*>(start),
+ size, MX_CACHE_FLUSH_INSN);
+ ASSERT(result == MX_OK);
#else
#error FlushICache only tested/supported on Android, Fuchsia, and Linux
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698