summaryrefslogtreecommitdiff
path: root/src/kernel/proc.h
diff options
context:
space:
mode:
authordzwdz2022-04-10 15:13:49 +0200
committerdzwdz2022-04-10 15:13:49 +0200
commit3e7d1acffd81175246fab1ed8be30569c9cd3289 (patch)
tree492540543055adb07904e86d17c7304663e16517 /src/kernel/proc.h
parent3c9ee975733680d816bb0e5d550f22aaa2f0a73f (diff)
kernel: idle process
Diffstat (limited to 'src/kernel/proc.h')
-rw-r--r--src/kernel/proc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/proc.h b/src/kernel/proc.h
index 2066b40..dc7525d 100644
--- a/src/kernel/proc.h
+++ b/src/kernel/proc.h
@@ -11,6 +11,7 @@ enum process_state {
PS_WAITS4CHILDDEATH,
PS_WAITS4FS,
PS_WAITS4REQUEST,
+ PS_WAITS4IRQ, // set by root vfs
};
struct process {
@@ -36,6 +37,10 @@ struct process {
int max_len;
struct fs_wait_response __user *res;
} awaited_req; // PS_WAITS4REQUEST
+ struct {
+ struct vfs_request req;
+ bool (*ready)();
+ } waits4irq;
};
struct vfs_request *handled_req;
@@ -56,6 +61,9 @@ struct process *process_fork(struct process *parent);
_Noreturn void process_switch(struct process *proc);
_Noreturn void process_switch_any(void); // switches to any running process
+/** If there are any processes waiting for IRQs, wait with them. Otherwise, shut down */
+_Noreturn void process_idle(void);
+
struct process *process_find(enum process_state);
size_t process_find_multiple(enum process_state, struct process **buf, size_t max);