refactor: Optimize the context switch overhead
[lunaix-os.git] / lunaix-os / includes / lunaix / process.h
index a8ac5d84c19e85aa48aa15341c07c7957a361526..bb55f0219c632897a8f6bfe4fc6e7d5a6d8a4745 100644 (file)
@@ -90,10 +90,10 @@ struct proc_info
 
     pid_t pid;                // offset = 0
     struct proc_info* parent; // offset = 4
 
     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
-    ptr_t page_table;         // offset = 88 -> 60 -> 64
-    void* fxstate;            // offset = 92 -> 64 -> 68
+    isr_param* intr_ctx;      // offset = 8
+    ptr_t ustack_top;         // offset = 84 -> 56 -> 60 -> 12
+    ptr_t page_table;         // offset = 88 -> 60 -> 64 -> 16
+    void* fxstate;            // offset = 92 -> 64 -> 68 -> 20
 
     /* ---- critical section end ---- */
 
 
     /* ---- critical section end ---- */
 
@@ -170,7 +170,7 @@ pid_t
 destroy_process(pid_t pid);
 
 void
 destroy_process(pid_t pid);
 
 void
-setup_proc_mem(struct proc_info* proc, ptr_t kstack_from);
+copy_kernel_stack(struct proc_info* proc, ptr_t kstack_from);
 
 /**
  * @brief 复制当前进程(LunaixOS的类 fork (unix) 实现)
 
 /**
  * @brief 复制当前进程(LunaixOS的类 fork (unix) 实现)