aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel/proc.c')
-rw-r--r--arch/riscv64/kernel/proc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index 2ccc5bc..3c2ea59 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -56,6 +56,12 @@ void set_thread(struct tcb *t)
r->tp = (long)t->thread_storage;
}
+vm_t get_stack(struct tcb *t)
+{
+ struct riscv_regs *r = (struct riscv_regs *)(t) - 1;
+ return r->sp;
+}
+
void save_regs(struct tcb *t, void *p)
{
struct riscv_regs *r = (struct riscv_regs *)(t) - 1;