Skip to content

Commit e32c913

Browse files
arch/riscv/syscall: Request 0 bytes of memory to run a process
Since the kernel can handle back requests of null memory, revert back to 0 memory. Signed-off-by: Ioan-Cristian CÎRSTEA <ioan.cirstea@oxidos.io>
1 parent 037c5b4 commit e32c913

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

arch/riscv/src/syscall.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ impl kernel::syscall::UserspaceKernelBoundary for SysCall {
121121

122122
fn initial_process_app_brk_size(&self) -> usize {
123123
// The RV32I UKB implementation does not use process memory for any
124-
// context switch state. However, the memory manager expects this value
125-
// to be non-zero.
126-
1
124+
// context switch state. Therefore, we do not need any process-accessible
125+
// memory to start with to successfully context switch to the process the
126+
// first time.
127+
0
127128
}
128129

129130
unsafe fn initialize_process(

0 commit comments

Comments
 (0)