refactor: cut off some bloats in intr_ctx
[lunaix-os.git] / lunaix-os / includes / lunaix / process.h
index c014443089bb557b35991bb7f1968c3873123a7b..291aba2d2a731f343621fb422412038a1af67049 100644 (file)
@@ -57,9 +57,9 @@ struct proc_info
     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
+    uintptr_t ustack_top;     // offset = 84 -> 56
+    void* page_table;         // offset = 88 -> 60
+    void* fxstate;            // offset = 92 -> 64
 
     /* ---- critical section end ---- */
 
@@ -93,6 +93,12 @@ struct proc_info
 
 extern volatile struct proc_info* __current;
 
+static inline void
+block_current()
+{
+    __current->state = PS_BLOCKED;
+}
+
 /**
  * @brief 分配并初始化一个进程控制块
  *