From a06dbb8a63d825ebb1ad65372ce1ce1f572891bc Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 21 Oct 2022 16:06:00 +0300 Subject: initial spawn implementation --- include/apos/tcb.h | 11 +++++++++++ include/arch/proc.h | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/apos/tcb.h b/include/apos/tcb.h index 63bf037..a31e308 100644 --- a/include/apos/tcb.h +++ b/include/apos/tcb.h @@ -75,6 +75,9 @@ enum tcb_notify { /** Thread control block. Main way to handle threads. */ struct tcb { + /** Execution continuation point. Important that it is first. */ + vm_t exec; + /** Arch-specific data. */ struct arch_tcbd tcbd; @@ -319,4 +322,12 @@ stat_t clone_rpc_maps(struct tcb *r); */ stat_t alloc_stacks(struct tcb *t); +/** + * Set address to jump to when returning to userspace. + * + * @param t Thread return address to set. + * @param r Address to jump to. + */ +void set_return(struct tcb *t, vm_t r); + #endif /* APOS_TCB_H */ diff --git a/include/arch/proc.h b/include/arch/proc.h index dd739bf..d5367f6 100644 --- a/include/arch/proc.h +++ b/include/arch/proc.h @@ -15,14 +15,6 @@ #include "../../arch/riscv32/include/proc.h" #endif -/** - * Set address to jump to when returning to userspace. - * - * @param r Address to jump to. - * @return \ref OK. - */ -stat_t set_return(vm_t r); - /** * Attach IPC data to load into argument registers when returning to userspace. * -- cgit v1.3