diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-03-17 00:30:12 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2021-03-25 22:21:06 -0700 |
commit | b9eba474fb52dbf205c7b466af458397a7487216 (patch) | |
tree | e203753f33c579d163b9c94bffa1d50c92c21b65 /pk/frontend.c | |
parent | 0b5ef9cf755811e6a8a2901585f3ecb5604e55f1 (diff) | |
download | pk-b9eba474fb52dbf205c7b466af458397a7487216.zip pk-b9eba474fb52dbf205c7b466af458397a7487216.tar.gz pk-b9eba474fb52dbf205c7b466af458397a7487216.tar.bz2 |
pk: support >2 GiB of user memory for RV64
Previously, the pk would always run from virtual address MEM_START.
Instead, remap it into the negative virtual addresses, allowing user
processes to expand beyond MEM_START.
Diffstat (limited to 'pk/frontend.c')
-rw-r--r-- | pk/frontend.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pk/frontend.c b/pk/frontend.c index a02cb89..cbe5377 100644 --- a/pk/frontend.c +++ b/pk/frontend.c @@ -5,6 +5,7 @@ #include "frontend.h" #include "syscall.h" #include "htif.h" +#include "mmap.h" #include <stdint.h> long frontend_syscall(long n, uint64_t a0, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6) @@ -23,7 +24,7 @@ long frontend_syscall(long n, uint64_t a0, uint64_t a1, uint64_t a2, uint64_t a3 magic_mem[6] = a5; magic_mem[7] = a6; - htif_syscall((uintptr_t)magic_mem); + htif_syscall(kva2pa_maybe(magic_mem)); long ret = magic_mem[0]; |