summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-12-12 21:56:44 +0100
committerRichard Braun <rbraun@sceen.net>2012-12-12 21:56:44 +0100
commit51bff7b18de9329d7bd77324cc597e72173fae74 (patch)
tree779b279c8ccb9f1d91b4ee8055718ae62771c8a1 /kern/thread.h
parent36cce230ead886a82521dd6988e2fe120eeef3fc (diff)
kern/thread: support multiprocessor scheduling
In practice, this merely means an idle thread now exists for each CPU, and threads can be preempted and rescheduled on each of them. There is currently no migration between processors.
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/thread.h b/kern/thread.h
index b7debddc..0022591d 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -57,6 +57,7 @@ struct thread {
*/
struct thread_runq {
struct thread *current;
+ struct thread *idle;
struct list threads;
} __aligned(CPU_L1_SIZE);
@@ -80,13 +81,13 @@ void thread_setup(void);
*
* If the given name is null, the task name is used instead.
*/
-int thread_create(struct thread **threadp, const char *name, struct task *task,
+int thread_create(struct thread **threadp, struct task *task, const char *name,
void (*fn)(void *), void *arg);
/*
* Start running threads on the local processor.
*
- * Interrupts are implicitely enabled when the first thread is dispatched.
+ * Interrupts must be enabled when calling this function.
*/
void __noreturn thread_run(void);