diff options
author | Andrew Waterman <andrew@sifive.com> | 2016-11-13 16:50:30 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2016-11-13 17:50:43 -0800 |
commit | 55ce524e7407bde35ca7a270de10caf0f73fb9da (patch) | |
tree | fc2e8627ebd383e75937b792ae78771cf06315a8 /pk/mmap.c | |
parent | ff807a20bd9a2b4b7e86cb49c466cac0a298b64e (diff) | |
download | pk-55ce524e7407bde35ca7a270de10caf0f73fb9da.zip pk-55ce524e7407bde35ca7a270de10caf0f73fb9da.tar.gz pk-55ce524e7407bde35ca7a270de10caf0f73fb9da.tar.bz2 |
Cap pk memory size to 2 GiB for RV32
Diffstat (limited to 'pk/mmap.c')
-rw-r--r-- | pk/mmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -385,6 +385,11 @@ void populate_mapping(const void* start, size_t size, int prot) uintptr_t pk_vm_init() { +#ifdef __riscv32 + // We can't support more than 2 GiB of memory in RV32 + mem_size = MIN(mem_size, 1U << 31); +#endif + size_t mem_pages = mem_size >> RISCV_PGSHIFT; free_pages = MAX(8, mem_pages >> (RISCV_PGLEVEL_BITS-1)); first_free_page = first_free_paddr; |