From dc9411669cd7830c26c810343d13b957e2fb3a19 Mon Sep 17 00:00:00 2001 From: Vihaan Jim Date: Tue, 4 Jul 2023 15:22:44 -0400 Subject: [PATCH] Correctly set process.inner on riscv This changes the process.inner.pid to the correct PID. Before, it was simply 1. This lead to problems, for example when sending messages where an assert checks to make sure that the current PID and the process PID are the same. Now, you can send messages from a new process. --- kernel/src/arch/riscv/process.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/src/arch/riscv/process.rs b/kernel/src/arch/riscv/process.rs index aad6fe336..331f69fe0 100644 --- a/kernel/src/arch/riscv/process.rs +++ b/kernel/src/arch/riscv/process.rs @@ -365,6 +365,7 @@ impl Process { } process.inner = Default::default(); + process.inner.pid = pid; // Mark the stack as "unallocated-but-free" let init_sp = (thread_init.stack.as_ptr() as usize) & !0xfff;