aboutsummaryrefslogtreecommitdiff
path: root/pk/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/mmap.c')
-rw-r--r--pk/mmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pk/mmap.c b/pk/mmap.c
index 37aa87a..dd0fe59 100644
--- a/pk/mmap.c
+++ b/pk/mmap.c
@@ -554,7 +554,8 @@ static void init_early_alloc()
current.mmap_max = current.brk_max = user_size;
extern char _end;
- first_free_page = ROUNDUP((uintptr_t)&_end, RISCV_PGSIZE);
+ volatile uintptr_t last_static_addr = (uintptr_t)&_end;
+ first_free_page = ROUNDUP(last_static_addr, RISCV_PGSIZE);
free_pages = (mem_size - (first_free_page - MEM_START)) / RISCV_PGSIZE;
}