refactor: keep in mind the stack layout is crucial. Move context switching & signal...
[lunaix-os.git] / lunaix-os / includes / lunaix / process.h
index 32b74dff5397e2fe29ce13eab3ef89ea3191f317..0b743d39c3058fff0d1d61b702ff149ae3a67d78 100644 (file)
@@ -4,6 +4,7 @@
 #include <arch/x86/interrupts.h>
 #include <lunaix/clock.h>
 #include <lunaix/mm/mm.h>
+#include <lunaix/signal.h>
 #include <lunaix/timer.h>
 #include <lunaix/types.h>
 #include <stdint.h>
@@ -26,20 +27,33 @@ struct proc_mm
     struct mm_region* regions;
 };
 
+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_info
 {
     pid_t pid;
     struct proc_info* parent;
-    isr_param intr_ctx;
+    isr_param intr_ctx; // size=76
+    uintptr_t ustack_top;
+    void* page_table;
     struct llist_header siblings;
     struct llist_header children;
     struct llist_header grp_member;
     struct proc_mm mm;
-    void* page_table;
     time_t created;
     uint8_t state;
     int32_t exit_code;
     int32_t k_status;
+    sigset_t sig_pending;
+    sigset_t sig_mask;
+    void* sig_handler[_SIG_NUM];
     pid_t pgid;
     struct lx_timer* timer;
 };