+struct proc_sigstate
+{
+ isr_param proc_regs;
+ char fxstate[512] __attribute__((aligned(16)));
+};
+
+struct proc_sig
+{
+ void* signal_handler;
+ int sig_num;
+ struct proc_sigstate prev_context;
+} __attribute__((packed));
+
+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; // offset = 0
+ struct proc_info* parent; // offset = 4
+ isr_param intr_ctx; // offset = 8
+ uintptr_t ustack_top; // offset = 84
+ void* page_table; // offset = 88
+ void* fxstate; // offset = 92
+
+ /* ---- critical section end ---- */
+
+ struct llist_header tasks;
+ struct llist_header siblings;
+ struct llist_header children;
+ struct llist_header grp_member;
+ waitq_t waitqueue;
+
+ struct
+ {
+ struct llist_header sleepers;
+ time_t wakeup_time;
+ time_t alarm_time;
+ } sleep;
+