X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/04ee277abd77fc51c5ab02ee58790a859607ea24..1fe5f5eb5378a47bf0f3451762743c162e40faad:/lunaix-os/includes/lunaix/process.h diff --git a/lunaix-os/includes/lunaix/process.h b/lunaix-os/includes/lunaix/process.h index 7d385a4..6ef1ff0 100644 --- a/lunaix-os/includes/lunaix/process.h +++ b/lunaix-os/includes/lunaix/process.h @@ -1,7 +1,6 @@ #ifndef __LUNAIX_PROCESS_H #define __LUNAIX_PROCESS_H -#include #include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include // 虽然内核不是进程,但为了区分,这里使用Pid=-1来指代内核。这主要是方便物理页所有权检查。 #define KERNEL_PID -1 @@ -45,8 +45,6 @@ #define proc_hanged(proc) (((proc)->state) & PS_BLOCKED) #define proc_runnable(proc) (((proc)->state) & PS_PAUSED) -#define PROC_FINPAUSE 1 - struct sigact { struct sigact* prev; @@ -76,17 +74,17 @@ struct proc_info { /* Any change to *critical section*, including layout, size - must be reflected in kernel/asm/x86/interrupt.S to avoid + must be reflected in arch/i386/interrupt.S.inc to avoid disaster! */ /* ---- critical section start ---- */ - pid_t pid; // offset = 0 - struct proc_info* parent; // offset = 4 - isr_param* intr_ctx; // offset = 8 - ptr_t ustack_top; // offset = 84 -> 56 -> 60 -> 12 - ptr_t page_table; // offset = 88 -> 60 -> 64 -> 16 + pid_t pid; + struct proc_info* parent; + isr_param* intr_ctx; + ptr_t ustack_top; + ptr_t page_table; /* ---- critical section end ---- */ @@ -108,7 +106,6 @@ struct proc_info u8_t state; int32_t exit_code; int32_t k_status; - int flags; struct sighail sigctx; struct v_fdtable* fdtable; struct v_dnode* cwd; @@ -195,4 +192,13 @@ get_process(pid_t pid); void proc_setsignal(struct proc_info* proc, int signum); +void +proc_clear_signal(struct proc_info* proc); + +// enable interrupt upon transfer +#define TRANSFER_IE 1 + +void +proc_init_transfer(struct proc_info* proc, ptr_t stop, ptr_t target, int flags); + #endif /* __LUNAIX_PROCESS_H */