feat: standard vga support (mode switching, framebuffer remapping)
[lunaix-os.git] / lunaix-os / includes / lunaix / process.h
index 1453e71634a72b5ee562f97131899693928ebb12..10dc5ec6513a90def740f1b2a82db41b1ca3f7ee 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __LUNAIX_PROCESS_H
 #define __LUNAIX_PROCESS_H
 
-#include <arch/x86/interrupts.h>
 #include <lunaix/clock.h>
 #include <lunaix/ds/waitq.h>
 #include <lunaix/fs.h>
@@ -11,6 +10,7 @@
 #include <lunaix/timer.h>
 #include <lunaix/types.h>
 #include <stdint.h>
+#include <sys/interrupts.h>
 
 // 虽然内核不是进程,但为了区分,这里使用Pid=-1来指代内核。这主要是方便物理页所有权检查。
 #define KERNEL_PID -1
@@ -74,7 +74,7 @@ struct proc_info
 {
     /*
         Any change to *critical section*, including layout, size
-        must be reflected in arch/x86/interrupt.S.inc to avoid
+        must be reflected in arch/i386/interrupt.S.inc to avoid
         disaster!
      */
 
@@ -195,4 +195,18 @@ proc_setsignal(struct proc_info* proc, int signum);
 void
 proc_clear_signal(struct proc_info* proc);
 
+// enable interrupt upon transfer
+#define TRANSFER_IE 1
+
+/**
+ * @brief Setup process initial context, used to initiate first switch
+ *
+ * @param proc
+ * @param stop
+ * @param target
+ * @param flags
+ */
+void
+proc_init_transfer(struct proc_info* proc, ptr_t stop, ptr_t target, int flags);
+
 #endif /* __LUNAIX_PROCESS_H */