aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorChristoph Müllner <christophm30@gmail.com>2021-04-28 14:51:58 +0200
committerGitHub <noreply@github.com>2021-04-28 05:51:58 -0700
commit12edfed73d2f601f7a23fded0d40a68cee958a2c (patch)
treea48408ee1d25381e71af5cdd259d8d412b754989 /pk
parentef7bebaf9bf24d3e90bcaae96387ce418e136b6d (diff)
downloadpk-12edfed73d2f601f7a23fded0d40a68cee958a2c.zip
pk-12edfed73d2f601f7a23fded0d40a68cee958a2c.tar.gz
pk-12edfed73d2f601f7a23fded0d40a68cee958a2c.tar.bz2
pk: Fix __clear_cache() compilation issue with recent compilers (#240)
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>
Diffstat (limited to 'pk')
-rw-r--r--pk/pk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pk/pk.c b/pk/pk.c
index 4f16abc..b8c9337 100644
--- a/pk/pk.c
+++ b/pk/pk.c
@@ -8,6 +8,7 @@
#include "frontend.h"
#include "bits.h"
#include "usermem.h"
+#include "flush_icache.h"
#include <stdbool.h>
elf_info current;
@@ -174,7 +175,7 @@ static void run_loaded_program(size_t argc, char** argv, uintptr_t kstack_top)
trapframe_t tf;
init_tf(&tf, current.entry, stack_top);
- __clear_cache(0, 0);
+ __riscv_flush_icache();
write_csr(sscratch, kstack_top);
start_user(&tf);
}