Commit f1bdc63a by Andrew Waterman Committed by Jim Wilson

RISC-V: Fix for icache flush issue on multicore processors.

	gcc/
	* config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
	* config/riscv/riscv.md (clear_cache): Use it.

From-SVN: r256109
parent a7e92aff
2018-01-02 Andrew Waterman <andrew@sifive.com>
* config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
* config/riscv/riscv.md (clear_cache): Use it.
2018-01-02 Artyom Skrobov <tyomitch@gmail.com> 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
* web.c: Remove out-of-date comment. * web.c: Remove out-of-date comment.
...@@ -45,6 +45,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -45,6 +45,8 @@ along with GCC; see the file COPYING3. If not see
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic " #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
#endif #endif
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
#define LINK_SPEC "\ #define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \ -melf" XLEN_SPEC "lriscv \
%{shared} \ %{shared} \
......
...@@ -1456,7 +1456,13 @@ ...@@ -1456,7 +1456,13 @@
(match_operand 1 "pmode_register_operand")] (match_operand 1 "pmode_register_operand")]
"" ""
{ {
#ifdef ICACHE_FLUSH_FUNC
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, ICACHE_FLUSH_FUNC),
LCT_NORMAL, VOIDmode, operands[0], Pmode,
operands[1], Pmode, const0_rtx, Pmode);
#else
emit_insn (gen_fence_i ()); emit_insn (gen_fence_i ());
#endif
DONE; DONE;
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment