X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/61a1daa59589212608039e2734009870818bacd3..0cf90cca0c924622f3fee8d2a3fafa8238363dc6:/lunaix-os/includes/lunaix/process.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/process.h b/lunaix-os/includes/lunaix/process.h index c7b925e..27137a1 100644 --- a/lunaix-os/includes/lunaix/process.h +++ b/lunaix-os/includes/lunaix/process.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -25,20 +26,18 @@ #define PROC_FINPAUSE 1 -struct proc_mm +struct proc_sigstate { - heap_context_t u_heap; - struct mm_region regions; + isr_param proc_regs; + char fxstate[512] __attribute__((aligned(16))); }; struct proc_sig { void* signal_handler; int sig_num; - isr_param prev_context; -}; - -#define PROC_SIG_SIZE sizeof(struct proc_sig) // size=84 + struct proc_sigstate prev_context; +} __attribute__((packed)); struct proc_info { @@ -50,11 +49,12 @@ struct proc_info /* ---- 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; // offset = 0 + struct proc_info* parent; // offset = 4 + isr_param intr_ctx; // offset = 8 + uintptr_t ustack_top; // offset = 84 -> 56 -> 60 + void* page_table; // offset = 88 -> 60 -> 64 + void* fxstate; // offset = 92 -> 64 -> 68 /* ---- critical section end ---- */ @@ -88,6 +88,12 @@ struct proc_info extern volatile struct proc_info* __current; +static inline void +block_current() +{ + __current->state = PS_BLOCKED; +} + /** * @brief 分配并初始化一个进程控制块 *