summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-12-09 23:59:47 +0100
committerRichard Braun <rbraun@sceen.net>2012-12-09 23:59:47 +0100
commit43efe2324da8d7644cccc2ec1b354fe6bd6c4028 (patch)
treee37f076429e17857f8b50065f5ba31dd83ca53f9 /kern/thread.c
parent2ea00731678790ed5712b19ad2fb84988682aaf5 (diff)
kern/thread: add preemption control functions
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 61a2d5b0..959208ab 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -28,15 +28,7 @@
#include <machine/cpu.h>
#include <machine/tcb.h>
-/*
- * Per processor run queue.
- */
-struct thread_runq {
- struct thread *current;
- struct list threads;
-} __aligned(CPU_L1_SIZE);
-
-static struct thread_runq thread_runqs[MAX_CPUS];
+struct thread_runq thread_runqs[MAX_CPUS];
/*
* Caches for allocated threads and their stacks.
@@ -72,12 +64,6 @@ thread_runq_dequeue(struct thread_runq *runq)
return thread;
}
-static inline struct thread_runq *
-thread_runq_local(void)
-{
- return &thread_runqs[cpu_id()];
-}
-
void __init
thread_setup(void)
{
@@ -138,6 +124,7 @@ thread_create(struct thread **threadp, const char *name, struct task *task,
name = task->name;
thread->flags = 0;
+ thread->preempt = 0;
thread->task = task;
thread->stack = stack;
strlcpy(thread->name, name, sizeof(thread->name));