diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/Support/Unix/Memory.inc | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Support/Unix/Memory.inc')
| -rw-r--r-- | gnu/llvm/lib/Support/Unix/Memory.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/llvm/lib/Support/Unix/Memory.inc b/gnu/llvm/lib/Support/Unix/Memory.inc index 848548d1817..adbfff2f59a 100644 --- a/gnu/llvm/lib/Support/Unix/Memory.inc +++ b/gnu/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__) || \ |
