arch/riscv: Don't set up virtual memory

Due to changes in the RISC-V Privileged Architecture specification,
Linux can now be started in physical memory and it will setup its own
page tables.

Thus we can delete most of virtual_memory.c.

Change-Id: I4e69d15f8ee540d2f98c342bc4ec0c00fb48def0
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/23772
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Jonathan Neuschäfer
2018-02-16 13:36:46 +01:00
committed by Martin Roth
parent 2764919dfb
commit b26759d703
4 changed files with 0 additions and 266 deletions

View File

@@ -32,36 +32,11 @@
#include <stdint.h>
#include <arch/encoding.h>
#define SUPERPAGE_SIZE ((uintptr_t)(RISCV_PGSIZE << RISCV_PGLEVEL_BITS))
#define VM_CHOICE VM_SV39
#define VA_BITS 39
#define MEGAPAGE_SIZE (SUPERPAGE_SIZE << RISCV_PGLEVEL_BITS)
#define EXTRACT_FIELD(val, which) (((val) & (which)) / ((which) & ~((which)-1)))
#define INSERT_FIELD(val, which, fieldval) (((val) & ~(which)) | ((fieldval) * ((which) & ~((which)-1))))
#define supervisor_paddr_valid(start, length) \
((uintptr_t)(start) >= current.first_user_vaddr + current.bias \
&& (uintptr_t)(start) + (length) < mem_size \
&& (uintptr_t)(start) + (length) >= (uintptr_t)(start))
typedef uintptr_t pte_t;
extern pte_t* root_page_table;
void initVirtualMemory(void);
size_t pte_ppn(pte_t pte);
pte_t ptd_create(uintptr_t ppn);
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,
pte_t *pageTableStart);
void mstatus_init(void); // need to setup mstatus so we know we have virtual memory
void flush_tlb(void);
#define DEFINE_MPRV_READ(name, type, insn) \
static inline type name(type *p); \