X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9eed27f6f2f002145667fb4abfc5e476b53630e5..78cd005fac540973751b5a108c37a715bc64b5a2:/lunaix-os/includes/lunaix/process.h diff --git a/lunaix-os/includes/lunaix/process.h b/lunaix-os/includes/lunaix/process.h index 10dc5ec..552ac4f 100644 --- a/lunaix-os/includes/lunaix/process.h +++ b/lunaix-os/includes/lunaix/process.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -110,26 +111,32 @@ struct proc_info struct v_fdtable* fdtable; struct v_dnode* cwd; pid_t pgid; + + struct iopoll pollctx; }; extern volatile struct proc_info* __current; +#define resume_process(proc) (proc)->state = PS_READY +#define pause_process(proc) (proc)->state = PS_PAUSED +#define block_process(proc) (proc)->state = PS_BLOCKED + static inline void block_current() { - __current->state = PS_BLOCKED; + block_process(__current); } static inline void pause_current() { - __current->state = PS_PAUSED; + pause_process(__current); } static inline void resume_current() { - __current->state = PS_RUNNING; + resume_process(__current); } /**