From 131af4eec38752a27e6e56579fbf76178e022ec1 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 1 Dec 2022 02:05:19 +0200 Subject: start looking into memory handling + Now 10M alloc/frees succeed, which totals more memory than the virtual machine has, so no too obvious leaks are occuring. For future debugging speed, changed 10M to 1M. + Also quick fix to rpcs, stacks are now assigned. Not entirely sure why they worked before this, but good that I found it. --- arch/riscv64/kernel/proc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/riscv64/kernel/proc.c') diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c index 0f19789..d58b41b 100644 --- a/arch/riscv64/kernel/proc.c +++ b/arch/riscv64/kernel/proc.c @@ -63,6 +63,13 @@ void set_thread(struct tcb *t) r->tp = (long)t->thread_storage; } +void set_stack(struct tcb *t, vm_t s) +{ + /** @todo also set frame pointer on architectures that need it? */ + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; + r->sp = s; +} + vm_t get_stack(struct tcb *t) { struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; -- cgit v1.3