aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/Unix/Memory.inc')
-rw-r--r--contrib/llvm/lib/Support/Unix/Memory.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/llvm/lib/Support/Unix/Memory.inc b/contrib/llvm/lib/Support/Unix/Memory.inc
index 848548d18177..adbfff2f59a5 100644
--- a/contrib/llvm/lib/Support/Unix/Memory.inc
+++ b/contrib/llvm/lib/Support/Unix/Memory.inc
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "Unix.h"
+#include "llvm/Config/config.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Process.h"
@@ -24,6 +25,10 @@
#include <mach/mach.h>
#endif
+#ifdef __Fuchsia__
+#include <zircon/syscalls.h>
+#endif
+
#if defined(__mips__)
# if defined(__OpenBSD__)
# include <mips64/sysarch.h>
@@ -32,7 +37,7 @@
# endif
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__)
extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
#else
extern "C" void __clear_cache(void *, void*);
@@ -205,6 +210,11 @@ void Memory::InvalidateInstructionCache(const void *Addr,
sys_icache_invalidate(const_cast<void *>(Addr), Len);
# endif
+#elif defined(__Fuchsia__)
+
+ zx_status_t Status = zx_cache_flush(Addr, Len, ZX_CACHE_FLUSH_INSN);
+ assert(Status == ZX_OK && "cannot invalidate instruction cache");
+
#else
# if (defined(__POWERPC__) || defined (__ppc__) || \