From 96e5d8dc99010e2cec8bd2edf59545bd13f6f769 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 28 May 2022 14:08:12 +0300 Subject: start implementing new proc/rpc handling + Essentially, separate root process and remote procedure call handling. I really should write down some documentation so I don't forget, but essentially: All threads share a common process virtual memory, and when a thread wants to make an rpc, it switches over to its own rpc vmem space that is linked to the remote process. --- arch/riscv64/kernel/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/riscv64/kernel') diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c index c95021d..0eb3ad2 100644 --- a/arch/riscv64/kernel/proc.c +++ b/arch/riscv64/kernel/proc.c @@ -25,14 +25,14 @@ stat_t set_return(vm_t v) return OK; } -stat_t prepare_thread(struct tcb *t) +stat_t set_thread(struct tcb *t, vm_t stack) { /* get location of registers in memory */ /* TODO: check alignment, should be fine but just to be sure */ struct riscv_regs *r = (struct riscv_regs *)(--t); /* insert important values into register slots */ - r->sp = (long)t->thread_stack_top; + r->sp = (long)stack; r->tp = (long)t; return OK; -- cgit v1.3