From 18baa991264e6ba7a416003721cf0fb19bf4582c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 19 Sep 2021 10:42:48 +0200 Subject: Merge llvm-project release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc3-8-g08642a395f23. PR: 258209 (cherry picked from commit 8c6f6c0c80f896f9c90b7833def615dcb0ce9244) --- contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c') diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c b/contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c index 3c12b74e8fa6..da0715914b41 100644 --- a/contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c +++ b/contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c @@ -35,7 +35,7 @@ uintptr_t GetCurrentProcess(void); #include #endif -#if defined(__OpenBSD__) && (defined(__arm__) || defined(__mips__)) +#if defined(__OpenBSD__) && (defined(__arm__) || defined(__mips__) || defined(__riscv)) // clang-format off #include #include @@ -166,6 +166,13 @@ void __clear_cache(void *start, void *end) { : "=r"(start_reg) : "r"(start_reg), "r"(end_reg), "r"(flags), "r"(syscall_nr)); assert(start_reg == 0 && "Cache flush syscall failed."); +#elif defined(__riscv) && defined(__OpenBSD__) + struct riscv_sync_icache_args arg; + + arg.addr = (uintptr_t)start; + arg.len = (uintptr_t)end - (uintptr_t)start; + + sysarch(RISCV_SYNC_ICACHE, &arg); #else #if __APPLE__ // On Darwin, sys_icache_invalidate() provides this functionality -- cgit v1.2.3