aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-24 22:07:51 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-24 22:22:48 +0100
commit192208770d3866838a450462dd4b1fc8e2b5c91a (patch)
treeec3f929b77d407ef57634cd917c04a13d614c8c8 /include
parent7f6b234625a53d2ceb9ec80dc0172aac1cedb358 (diff)
downloadfbos-192208770d3866838a450462dd4b1fc8e2b5c91a.tar.gz
fbos-192208770d3866838a450462dd4b1fc8e2b5c91a.zip
Simplify scheduling by introducing an init process
Scheduling is easier if there is an init process which does nothing. This way we don't have to perform hacks in order to idle in S privilege mode while touching special registers in weird ways. For now this process is kind of costly since 'wfi' is not accepted in this context, but this can be further tuned down in the future by setting TW=1 on 'mstatus', or by handling the exception and allowing it if it comes from the proper process. All of that being said, there is still work to be done as things fail when optimitzations are on. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/fbos/sched.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/fbos/sched.h b/include/fbos/sched.h
index c2a4b19..e05d0a1 100644
--- a/include/fbos/sched.h
+++ b/include/fbos/sched.h
@@ -23,10 +23,7 @@ struct task_struct {
// Tasks available on this kernel.
extern struct task_struct tasks[4];
-// Identifier for the next task to be run.
-extern int next_task;
-
-// Bring the machine to idle mode.
-__noreturn __kernel void idle(void);
+// Switch execution to the given task id.
+void switch_to(int task_id);
#endif // __FBOS_SCHED_H_