aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-12-01 02:05:19 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-12-01 02:05:19 +0200
commit131af4eec38752a27e6e56579fbf76178e022ec1 (patch)
tree1940634f69a44395fc6945b25c5cbc8b68bba876 /arch/riscv64/kernel
parente25f1e7a8f8f2320546ad4950464713d85b47785 (diff)
downloadkmi-131af4eec38752a27e6e56579fbf76178e022ec1.tar.gz
kmi-131af4eec38752a27e6e56579fbf76178e022ec1.zip
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.
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/proc.c7
1 files changed, 7 insertions, 0 deletions
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;