diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-06-11 19:08:18 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-06-11 19:08:18 +0300 |
| commit | 426da8be0db33405b0cfe53108b65040623972f0 (patch) | |
| tree | c1776cf14695d717a92d5d46d7a07c978a0e3618 /include/arch/proc.h | |
| parent | de99380f12f8e2fe4acf7734db0e1e37a356c45f (diff) | |
| download | kmi-426da8be0db33405b0cfe53108b65040623972f0.tar.gz kmi-426da8be0db33405b0cfe53108b65040623972f0.zip | |
continue documentation
Diffstat (limited to 'include/arch/proc.h')
| -rw-r--r-- | include/arch/proc.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/include/arch/proc.h b/include/arch/proc.h index 7c6ad5b..e27fbf6 100644 --- a/include/arch/proc.h +++ b/include/arch/proc.h @@ -12,10 +12,45 @@ #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. + * + * @param t Thread that will run after return. + * @param pid Process ID. + * @param tid Thread ID. + * @return \ref OK. + */ stat_t set_ipc(struct tcb *t, id_t pid, id_t tid); -/*\todo: should this be in arch/tcb.h or something? */ -stat_t set_thread(struct tcb *t, vm_t stack); + +/** \todo Should these be in arch/tcb.h or something? */ +/** \todo Should these be void? */ + +/** + * Attach thread stack and thread local storage when returning to userspace. + * + * Their info should already be stored in \c t, and this function just + * actualizes the information. + * + * @param t Thread that will run after return. + * @return \ref OK. + */ +stat_t set_thread(struct tcb *t); + +/** + * Run \c init program. + * + * @param t Thread that \c init is attached to. + * @param fdt Pointer to FDT that is passed to \c init. + * @return \ref ERR_ADDR, as it shouldn't return- + */ stat_t run_init(struct tcb *t, void *fdt); #endif /* APOS_ARCH_PROC_H */ |
