X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/12293ed1d71cd306ed9a5d021a79ba945fe4e680..191c47396747e54457510c7e126b6ba098fefbbd:/lunaix-os/includes/lunaix/process.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/process.h b/lunaix-os/includes/lunaix/process.h index 26f33bd..2cd4330 100644 --- a/lunaix-os/includes/lunaix/process.h +++ b/lunaix-os/includes/lunaix/process.h @@ -21,10 +21,12 @@ #define PROC_TERMMASK 0x6 +#define PROC_FINPAUSE 1 + struct proc_mm { heap_context_t u_heap; - struct mm_region* regions; + struct mm_region regions; }; struct proc_sig @@ -64,6 +66,7 @@ struct proc_info int32_t k_status; sigset_t sig_pending; sigset_t sig_mask; + int flags; void* sig_handler[_SIG_NUM]; pid_t pgid; struct lx_timer* timer; @@ -71,11 +74,21 @@ struct proc_info extern volatile struct proc_info* __current; -pid_t -alloc_pid(); +/** + * @brief 分配并初始化一个进程控制块 + * + * @return struct proc_info* + */ +struct proc_info* +alloc_process(); +/** + * @brief 初始化进程用户空间 + * + * @param pcb + */ void -init_proc(struct proc_info* pcb); +init_proc_user_space(struct proc_info* pcb); /** * @brief 向系统发布一个进程,使其可以被调度。 @@ -83,7 +96,7 @@ init_proc(struct proc_info* pcb); * @param process */ void -push_process(struct proc_info* process); +commit_process(struct proc_info* process); pid_t destroy_process(pid_t pid);