diff options
author | Marvin Borner | 2020-09-07 00:17:04 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-07 00:17:04 +0200 |
commit | 9c2f40441e0cc909ebefe432ddc10e2de29b82ac (patch) | |
tree | 2dcdd4ae56faab40f4bbbee27e72023e3b8acdbb /kernel/inc | |
parent | 97f57cf4da45d268bbea863ae7bf40bb8c749aad (diff) |
Added wait syscall.
This makes a process sleep until it receives a new message (no polling!).
I thought that this will result in performance improvements but I haven't
noticed any, yet. Maybe I'll remove this again in the future..
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/proc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h index 2335d5d..9d4906d 100644 --- a/kernel/inc/proc.h +++ b/kernel/inc/proc.h @@ -17,7 +17,7 @@ #define GDT_USER_CODE_OFFSET 0x1b // User code segment offset in GDT (with ring3 mask) #define GDT_USER_DATA_OFFSET 0x23 // User data segment offset in GDT (with ring3 mask) -enum proc_state { PROC_DEFAULT }; +enum proc_state { PROC_DEFAULT, PROC_WAITING }; struct proc { u32 pid; @@ -36,9 +36,12 @@ struct proc_message { struct proc *kernel_proc; +void scheduler_enable(); +void scheduler_disable(); void proc_init(); void proc_print(); struct proc *proc_current(); +int proc_awake(); void proc_send(struct proc *src, struct proc *dest, enum message_type type, void *data); struct proc_message *proc_receive(struct proc *proc); struct proc *proc_from_pid(u32 pid); |