diff options
author | Andrew Waterman <andrew@sifive.com> | 2017-04-18 09:59:04 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2017-04-18 09:59:04 -0700 |
commit | 0f0ac647fe646529c51b5f5c68221502dc88d239 (patch) | |
tree | 02a9b1eadab3d341a1992e20a7b1ef2c174483f2 /pk | |
parent | 5f736b9ab82ad19e03fc720c63f08e01a72712cc (diff) | |
download | pk-0f0ac647fe646529c51b5f5c68221502dc88d239.zip pk-0f0ac647fe646529c51b5f5c68221502dc88d239.tar.gz pk-0f0ac647fe646529c51b5f5c68221502dc88d239.tar.bz2 |
Increase PK stack size to 3% of memory, up to 8 MiB
Diffstat (limited to 'pk')
-rw-r--r-- | pk/mmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -401,7 +401,7 @@ uintptr_t pk_vm_init() current.mmap_max = current.brk_max = MIN(DRAM_BASE, mem_size - (first_free_paddr - DRAM_BASE)); - size_t stack_size = RISCV_PGSIZE * 64; + size_t stack_size = MIN(mem_pages >> 5, 2048) * RISCV_PGSIZE; size_t stack_bottom = __do_mmap(current.mmap_max - stack_size, stack_size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, 0, 0); kassert(stack_bottom != (uintptr_t)-1); current.stack_top = stack_bottom + stack_size; |