summaryrefslogtreecommitdiff
path: root/src/arch/riscv/include/vm.h
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2016-10-19 08:07:13 -0700
committerRonald G. Minnich <rminnich@gmail.com>2016-10-24 20:25:04 +0200
commit5965cba3dc1fc48b1a1734fc21c05950ccc7cc4f (patch)
treeaef12a167553dacca6305aa7e99d46695f9c1534 /src/arch/riscv/include/vm.h
parent0a48aee795942538e006bba42c188ee95afb49bb (diff)
downloadcoreboot-5965cba3dc1fc48b1a1734fc21c05950ccc7cc4f.tar.xz
RISCV: Clean up the common architectural code
This version of coreboot successfully starts a Harvey (Plan 9) kernel as a payload, entering main() with no supporting assembly code for startup. The Harvey port is not complete so it just panics but ... it gets started. We provide a standard payload function that takes a pointer argument and makes the jump from machine to supervisor mode; the days of kernels running in machine mode are over. We do some small tweaks to the virtual memory code. We temporarily disable two functions that won't work on some targets as register numbers changed between 1.7 and 1.9. Once lowrisc catches up we'll reenable them. We add the PAGETABLES to the memlayout.ld and use _pagetables in the virtual memory setup code. We now use the _stack and _estack from memlayout so we know where things are. As time goes on maybe we can kill all the magic numbers. Change-Id: I6caadfa9627fa35e31580492be01d4af908d31d9 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/17058 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/arch/riscv/include/vm.h')
-rw-r--r--src/arch/riscv/include/vm.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/arch/riscv/include/vm.h b/src/arch/riscv/include/vm.h
index bee2ed4215..c3de47aa5c 100644
--- a/src/arch/riscv/include/vm.h
+++ b/src/arch/riscv/include/vm.h
@@ -37,16 +37,6 @@
#define VA_BITS 39
#define MEGAPAGE_SIZE (SUPERPAGE_SIZE << RISCV_PGLEVEL_BITS)
-#define PROT_READ 1
-#define PROT_WRITE 2
-#define PROT_EXEC 4
-
-#define MAP_PRIVATE 0x2
-#define MAP_FIXED 0x10
-#define MAP_ANONYMOUS 0x20
-#define MAP_POPULATE 0x8000
-#define MREMAP_FIXED 0x2
-
#define EXTRACT_FIELD(val, which) (((val) & (which)) / ((which) & ~((which)-1)))
#define INSERT_FIELD(val, which, fieldval) (((val) & ~(which)) | ((fieldval) * ((which) & ~((which)-1))))
@@ -66,7 +56,8 @@ pte_t pte_create(uintptr_t ppn, int prot, int user);
void print_page_table(void);
-void init_vm(uintptr_t virtMemStart, uintptr_t physMemStart, uintptr_t pageTableStart);
+void init_vm(uintptr_t virtMemStart, uintptr_t physMemStart,
+ pte_t *pageTableStart);
void mstatus_init(void); // need to setup mstatus so we know we have virtual memory
void flush_tlb(void);