From a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 9 Nov 2022 16:27:23 +0200 Subject: add basic IPI structure --- arch/riscv64/kernel/proc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'arch/riscv64/kernel/proc.c') 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 #include +#include #include @@ -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; +} -- cgit v1.3