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: r256110
This commit is contained in:
Andrew Waterman 2018-01-02 20:57:54 +00:00 committed by Jim Wilson
parent 27f04c8cc7
commit 1b4f0bcf4b
3 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/83608

View File

@ -45,6 +45,8 @@ along with GCC; see the file COPYING3. If not see
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
#endif
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \

View File

@ -1429,7 +1429,13 @@
(match_operand 1 "pmode_register_operand")]
""
{
#ifdef ICACHE_FLUSH_FUNC
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, ICACHE_FLUSH_FUNC),
LCT_NORMAL, VOIDmode, 3, operands[0], Pmode,
operands[1], Pmode, const0_rtx, Pmode);
#else
emit_insn (gen_fence_i ());
#endif
DONE;
})