Browse Source

"Fix" RV32 programs running on RV64 pk

Only allocate virtual addresses under 2^31.  We might revise the
RV32-on-RV64 semantics to zero-extend the RV32 virtual addresses,
which would allow the user program's use of the full 4 GB.
pull/9/head
Andrew Waterman 11 years ago
parent
commit
2d8f51fcca
  1. 4
      pk/vm.c

4
pk/vm.c

@ -485,6 +485,10 @@ void supervisor_vm_init()
uintptr_t pk_vm_init()
{
// keep RV32 addresses positive
if (!current.elf64)
current.mmap_max = MIN(current.mmap_max, 0x80000000);
__map_kernel_range(0, 0, current.first_free_paddr, PROT_READ|PROT_WRITE|PROT_EXEC);
__map_kernel_range(first_free_page, first_free_page, free_pages * RISCV_PGSIZE, PROT_READ|PROT_WRITE);

Loading…
Cancel
Save