diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-09-19 08:42:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-12-06 16:30:05 +0000 |
commit | 18baa991264e6ba7a416003721cf0fb19bf4582c (patch) | |
tree | 51c80b7ddfe8514c81c6f2f0436b00dffadaf825 /contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c | |
parent | c77c1b5c48476e0b0f6d3f4ea9dbf2c744eb1765 (diff) | |
download | src-18baa991264e6ba7a416003721cf0fb19bf4582c.tar.gz src-18baa991264e6ba7a416003721cf0fb19bf4582c.zip |
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)
Diffstat (limited to 'contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c')
-rw-r--r-- | contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 <machine/sysarch.h> #endif -#if defined(__OpenBSD__) && (defined(__arm__) || defined(__mips__)) +#if defined(__OpenBSD__) && (defined(__arm__) || defined(__mips__) || defined(__riscv)) // clang-format off #include <sys/types.h> #include <machine/sysarch.h> @@ -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 |