feat: input device subsystem to resolve race condition on polling input
[lunaix-os.git] / lunaix-os / includes / lunaix / process.h
index 7c8c114a8c607ceb4c333ed7e6ee8e2db0e7ee3b..9686ee074de99ec4fb88c1e4e42703d627d7c907 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <arch/x86/interrupts.h>
 #include <lunaix/clock.h>
+#include <lunaix/ds/waitq.h>
 #include <lunaix/fs.h>
 #include <lunaix/mm/mm.h>
 #include <lunaix/signal.h>
@@ -13,7 +14,7 @@
 // 虽然内核不是进程,但为了区分,这里使用Pid=-1来指代内核。这主要是方便物理页所有权检查。
 #define KERNEL_PID -1
 
-#define PS_STOPPED 0
+#define PS_READY 0
 #define PS_RUNNING 1
 #define PS_TERMNAT 2
 #define PS_DESTROY 4
@@ -60,6 +61,7 @@ struct proc_info
     struct llist_header siblings;
     struct llist_header children;
     struct llist_header grp_member;
+    waitq_t waitqueue;
 
     struct
     {
@@ -79,6 +81,7 @@ struct proc_info
     int flags;
     void* sig_handler[_SIG_NUM];
     struct v_fdtable* fdtable;
+    struct v_dnode* cwd;
     pid_t pgid;
 };