aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/proc.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/inc/proc.h')
-rw-r--r--kernel/inc/proc.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h
index 1144782..b8310d1 100644
--- a/kernel/inc/proc.h
+++ b/kernel/inc/proc.h
@@ -4,12 +4,12 @@
#define PROC_H
#include <def.h>
-#include <drivers/interrupts.h>
+#include <drivers/int.h>
#include <list.h>
#include <stack.h>
#include <sys.h>
-#define PROC_QUANTUM 42 // Milliseconds or something // TODO
+#define PROC_QUANTUM 15 // Milliseconds or something // TODO
#define PROC_STACK_SIZE 0x4000 // 16KiB
#define EFLAGS_ALWAYS 0x2 // Always one
@@ -26,8 +26,8 @@ struct proc {
char name[64];
char dir[64];
+ u8 fpu[512];
struct page_dir *page_dir;
- struct regs regs;
enum proc_priv priv;
enum proc_state state;
struct stack *messages;
@@ -37,7 +37,9 @@ struct proc {
struct {
u32 user;
+ u32 user_ptr;
u32 kernel;
+ u32 kernel_ptr;
} stack;
struct {
@@ -51,20 +53,21 @@ struct proc {
} quantum;
};
-void scheduler(struct regs *regs) NONNULL;
+u32 scheduler(u32 esp);
NORETURN void proc_init(void);
void proc_print(void);
struct proc *proc_current(void);
u8 proc_super(void);
u8 proc_idle(void);
struct proc *proc_from_pid(u32 pid);
-void proc_exit(struct proc *proc, struct regs *r, s32 status) NONNULL;
+void proc_exit(struct proc *proc, s32 status) NONNULL;
void proc_yield(void);
-void proc_yield_regs(struct regs *r) NONNULL;
-void proc_set_quantum(struct proc *proc, u32 value);
-void proc_reset_quantum(struct proc *proc);
-void proc_state(struct proc *proc, enum proc_state state);
+void proc_set_quantum(struct proc *proc, u32 value) NONNULL;
+void proc_reset_quantum(struct proc *proc) NONNULL;
+void proc_state(struct proc *proc, enum proc_state state) NONNULL;
struct proc *proc_make(enum proc_priv priv);
-void proc_stack_push(struct proc *proc, u32 data) NONNULL;
+void proc_make_regs(struct proc *proc);
+void proc_stack_user_push(struct proc *proc, const void *data, u32 size) NONNULL;
+void proc_stack_kernel_push(struct proc *proc, const void *data, u32 size) NONNULL;
#endif