aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2021-03-29 16:54:09 -0700
committerAndrew Waterman <andrew@sifive.com>2021-03-29 16:58:17 -0700
commitc09d4af850ff8b502b5efd4de1aac39fcbc63618 (patch)
tree90bec479c44091334db0f5ab46775b84c22d285c
parentfe486e5c8555dd199061ad42f56d748b74704e97 (diff)
downloadriscv-pk-c09d4af850ff8b502b5efd4de1aac39fcbc63618.zip
riscv-pk-c09d4af850ff8b502b5efd4de1aac39fcbc63618.tar.gz
riscv-pk-c09d4af850ff8b502b5efd4de1aac39fcbc63618.tar.bz2
M-mode code doesn't need access to pk's page table
-rw-r--r--machine/minit.c1
-rw-r--r--machine/vm.h1
-rw-r--r--pk/mmap.c2
3 files changed, 2 insertions, 2 deletions
diff --git a/machine/minit.c b/machine/minit.c
index 2fb67a4..cf80a98 100644
--- a/machine/minit.c
+++ b/machine/minit.c
@@ -14,7 +14,6 @@
#include <string.h>
#include <limits.h>
-pte_t* root_page_table;
uintptr_t mem_size;
volatile uint64_t* mtime;
volatile uint32_t* plic_priorities;
diff --git a/machine/vm.h b/machine/vm.h
index 9436ffb..e65b19e 100644
--- a/machine/vm.h
+++ b/machine/vm.h
@@ -17,7 +17,6 @@
#endif
typedef uintptr_t pte_t;
-extern pte_t* root_page_table;
static inline void flush_tlb()
{
diff --git a/pk/mmap.c b/pk/mmap.c
index a19b9a6..97df4e4 100644
--- a/pk/mmap.c
+++ b/pk/mmap.c
@@ -24,6 +24,8 @@ typedef struct vmr_t {
static vmr_t* vmr_freelist_head;
+static pte_t* root_page_table;
+
#define RISCV_PGLEVELS ((VA_BITS - RISCV_PGSHIFT) / RISCV_PGLEVEL_BITS)
static spinlock_t vm_lock = SPINLOCK_INIT;