u16_t rss64_iomap;
} __attribute__((packed));
-typedef struct stack_frame stack_frame_t;
-
-struct stack_frame {
- u32_t cr3;
- u32_t ds;
- u32_t edi;
- u32_t esi;
- u32_t ebp;
- u32_t esp;
- u32_t ebx;
- u32_t edx;
- u32_t ecx;
- u32_t eax;
- u32_t intn;
- u32_t error;
- u32_t eip;
- u32_t cs;
- u32_t eflags;
- u32_t prevesp;
- u32_t ss;
-} __attribute__((packed));
-
struct cpu {
segment_descriptor_t cpu_gdt[GDT_ENTRIES];
segment_descriptor_t cpu_idt[IDT_ENTRIES];
#ifndef __ARCH_H
#define __ARCH_H
-#include <corax/types.h>
-
#define TASK_STATE_NEW 0
#define TASK_STATE_RUNNING 1
#define TASK_STATE_READY 2
#define TASK_STATE_WAITING 3
#define TASK_STATE_BROKEN 4
#define TASK_STATE_EXIT 5
+#define TASK_STATE_FORKED 6
+
+#ifndef __ASSEMBLY_SOURCE
+
+#include <corax/types.h>
+
+typedef struct stack_frame stack_frame_t;
+
+struct stack_frame {
+ u32_t cr3;
+ u32_t ds;
+ u32_t edi;
+ u32_t esi;
+ u32_t ebp;
+ u32_t esp;
+ u32_t ebx;
+ u32_t edx;
+ u32_t ecx;
+ u32_t eax;
+ u32_t intn;
+ u32_t error;
+ u32_t eip;
+ u32_t cs;
+ u32_t eflags;
+ u32_t prevesp;
+ u32_t ss;
+} __attribute__((packed));
typedef struct task task_t;
u32_t cpu_set_pstate(int pstate);
int task_prepare(struct task*, u32_t cr3, u32_t eip, u32_t esp0, u32_t esp, u32_t priv);
+int task_prepare_fork(struct task*);
int task_switch(struct task*);
task_t* task_get_current(void);
int pg_dir_memcpy(pg_dir_t*, void*, pg_dir_t*, void*, u32_t);
+#endif /* !__ASSEMBLY_SOURCE */
+
#endif /* __ARCH_H */