aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/proc.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-11-09 16:27:23 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-11-09 17:27:11 +0200
commita3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b (patch)
treeae319c8f389e7ca39bbdd4b114655f8604563305 /arch/riscv64/kernel/proc.c
parent2b5533aefef026fe7bada314ebdb2651b809979a (diff)
downloadkmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.tar.gz
kmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.zip
add basic IPI structure
Diffstat (limited to 'arch/riscv64/kernel/proc.c')
-rw-r--r--arch/riscv64/kernel/proc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index ed8bf93..d2b8dfb 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -8,6 +8,7 @@
#include <apos/tcb.h>
#include <apos/elf.h>
+#include <apos/string.h>
#include <arch/proc.h>
@@ -54,3 +55,25 @@ void set_thread(struct tcb *t)
r->sp = (long)t->thread_stack_top;
r->tp = (long)t->thread_storage;
}
+
+void save_regs(struct tcb *t, void *p)
+{
+ struct riscv_regs *r = (struct riscv_regs *)(t++);
+ memcpy(p, r, sizeof(*r));
+}
+
+void load_regs(void *p, struct tcb *t)
+{
+ struct riscv_regs *r = (struct riscv_regs *)(t++);
+ memcpy(r, p, sizeof(*r));
+}
+
+void adjust_ipi(struct tcb *t)
+{
+ UNUSED(t);
+}
+
+void adjust_syscall(struct tcb *t)
+{
+ t->exec += 4;
+}