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: signal support (tested!)
[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 0b743d39c3058fff0d1d61b702ff149ae3a67d78..7a5d5024ef0c2a41c0ad0a2b9ddf62e35e9d9615 100644
(file)
--- a/
lunaix-os/includes/lunaix/process.h
+++ b/
lunaix-os/includes/lunaix/process.h
@@
-24,7
+24,7
@@
struct proc_mm
{
heap_context_t u_heap;
struct proc_mm
{
heap_context_t u_heap;
- struct mm_region
*
regions;
+ struct mm_region regions;
};
struct proc_sig
};
struct proc_sig
@@
-38,11
+38,22
@@
struct proc_sig
struct proc_info
{
struct proc_info
{
+ /*
+ Any change to *critical section*, including layout, size
+ must be reflected in kernel/asm/x86/interrupt.S to avoid
+ disaster!
+ */
+
+ /* ---- critical section start ---- */
+
pid_t pid;
struct proc_info* parent;
isr_param intr_ctx; // size=76
uintptr_t ustack_top;
void* page_table;
pid_t pid;
struct proc_info* parent;
isr_param intr_ctx; // size=76
uintptr_t ustack_top;
void* page_table;
+
+ /* ---- critical section end ---- */
+
struct llist_header siblings;
struct llist_header children;
struct llist_header grp_member;
struct llist_header siblings;
struct llist_header children;
struct llist_header grp_member;
@@
-60,11
+71,21
@@
struct proc_info
extern volatile struct proc_info* __current;
extern volatile struct proc_info* __current;
-pid_t
-alloc_pid();
+/**
+ * @brief 分配并初始化一个进程控制块
+ *
+ * @return struct proc_info*
+ */
+struct proc_info*
+alloc_process();
+/**
+ * @brief 初始化进程用户空间
+ *
+ * @param pcb
+ */
void
void
-init_proc(struct proc_info* pcb);
+init_proc
_user_space
(struct proc_info* pcb);
/**
* @brief 向系统发布一个进程,使其可以被调度。
/**
* @brief 向系统发布一个进程,使其可以被调度。
@@
-72,7
+93,7
@@
init_proc(struct proc_info* pcb);
* @param process
*/
void
* @param process
*/
void
-
push
_process(struct proc_info* process);
+
commit
_process(struct proc_info* process);
pid_t
destroy_process(pid_t pid);
pid_t
destroy_process(pid_t pid);