diff options
Diffstat (limited to 'kernel/inc/proc.h')
-rw-r--r-- | kernel/inc/proc.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h index 5fc217c..6be7da3 100644 --- a/kernel/inc/proc.h +++ b/kernel/inc/proc.h @@ -4,12 +4,12 @@ #define PROC_H #include <def.h> -#include <event.h> #include <interrupts.h> #include <list.h> +#include <stack.h> #include <sys.h> -#define PROC_QUANTUM 100 // Milliseconds or something // TODO +#define PROC_QUANTUM 42 // Milliseconds or something // TODO #define EFLAGS_ALWAYS 0x2 // Always one #define EFLAGS_INTERRUPTS 0x200 // Enable interrupts @@ -19,32 +19,29 @@ enum proc_state { PROC_RUNNING, PROC_SLEEPING }; +struct proc_wait { + u32 id; // dev_id + s32 (*func)(); +}; + struct proc { u32 pid; char name[32]; struct regs regs; - struct regs regs_backup; + struct proc_wait wait; // dev_id enum proc_state state; - struct list *messages; + struct stack *messages; }; -struct proc_message { - struct proc *src; - struct proc *dest; - struct message *msg; -}; - -struct proc *kernel_proc; - void scheduler(struct regs *regs); void proc_init(void); void proc_print(void); struct proc *proc_current(void); -void proc_send(struct proc *src, struct proc *dest, u32 type, void *data); -struct proc_message *proc_receive(struct proc *proc); struct proc *proc_from_pid(u32 pid); void proc_exit(struct proc *proc, int status); void proc_yield(struct regs *r); +void proc_clear_quantum(); +void proc_enable_waiting(u32 dev_id); struct proc *proc_make(void); #endif |