git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: The waitpid family!
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
process.h
diff --git
a/lunaix-os/includes/lunaix/process.h
b/lunaix-os/includes/lunaix/process.h
index d9a5bb189058ed2aa1fa38b39688dbe993aa851e..76ecaccf0b2884deb0460a345006aae62a7fb69b 100644
(file)
--- a/
lunaix-os/includes/lunaix/process.h
+++ b/
lunaix-os/includes/lunaix/process.h
@@
-15,8
+15,10
@@
#define PROC_RUNNING 1
#define PROC_TERMNAT 2
#define PROC_DESTROY 4
#define PROC_RUNNING 1
#define PROC_TERMNAT 2
#define PROC_DESTROY 4
-#define PROC_SPOILED 8
-#define PROC_BLOCKED 16
+#define PROC_BLOCKED 8
+#define PROC_CREATED 16
+
+#define PROC_TERMMASK 0x6
struct proc_mm {
struct proc_mm {
@@
-28,6
+30,8
@@
struct proc_info {
pid_t pid;
struct proc_info* parent;
isr_param intr_ctx;
pid_t pid;
struct proc_info* parent;
isr_param intr_ctx;
+ struct llist_header siblings;
+ struct llist_header children;
struct proc_mm mm;
void* page_table;
time_t created;
struct proc_mm mm;
void* page_table;
time_t created;
@@
-37,11
+41,13
@@
struct proc_info {
struct lx_timer* timer;
};
struct lx_timer* timer;
};
-extern struct proc_info* __current;
+extern
volatile
struct proc_info* __current;
pid_t alloc_pid();
pid_t alloc_pid();
+void init_proc(struct proc_info *pcb);
+
/**
* @brief 向系统发布一个进程,使其可以被调度。
*
/**
* @brief 向系统发布一个进程,使其可以被调度。
*
@@
-49,7
+55,7
@@
pid_t alloc_pid();
*/
void push_process(struct proc_info* process);
*/
void push_process(struct proc_info* process);
-
void
destroy_process(pid_t pid);
+
pid_t
destroy_process(pid_t pid);
void setup_proc_mem(struct proc_info* proc, uintptr_t kstack_from);
void setup_proc_mem(struct proc_info* proc, uintptr_t kstack_from);
@@
-57,7
+63,7
@@
void setup_proc_mem(struct proc_info* proc, uintptr_t kstack_from);
* @brief 复制当前进程(LunaixOS的类 fork (unix) 实现)
*
*/
* @brief 复制当前进程(LunaixOS的类 fork (unix) 实现)
*
*/
-
void
dup_proc();
+
pid_t
dup_proc();
/**
* @brief 创建新进程(LunaixOS的类 CreateProcess (Windows) 实现)
/**
* @brief 创建新进程(LunaixOS的类 CreateProcess (Windows) 实现)