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 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/apos') 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 */ -- cgit v1.3