riscv-software-src / riscv-pk

RISC-V Proxy Kernel
Other
579 stars 306 forks source link

pk: Fix __clear_cache() compilation issue with recent compilers #240

Closed cmuellner closed 3 years ago

cmuellner commented 3 years ago

Using recent compilers we get the following error message:

../pk/pk.c: In function 'run_loaded_program.constprop': ../pk/pk.c:177:3: error: both arguments to 'builtin___clear_cache' must be pointers 177 | clear_cache(0, 0); | ^~~~~~~

Let's use the existing function __riscv_flush_icache(), give it a header with a prototype and use it to emits the FENCE.I instruction directly.

See #239

Suggested-by: Andrew Waterman andrew@sifive.com Signed-off-by: Christoph Muellner cmuellner@linux.com

aswaterman commented 3 years ago

Forgot about that function. LGTM!