summaryrefslogtreecommitdiff
path: root/interrupt/fault.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2013-07-07 21:44:10 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2013-07-20 08:43:10 +0200
commit657d427aa41e6e05c8c4d4b1179b42d3363e8018 (patch)
treef6d7214d07bcb6a70dab933515ad8427d032c473 /interrupt/fault.cpp
parent39b1c8afdf2713ca12123ef00f32d14a95dadab4 (diff)
Use intrusive list to keep track of ready threads.
Diffstat (limited to 'interrupt/fault.cpp')
-rw-r--r--interrupt/fault.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/interrupt/fault.cpp b/interrupt/fault.cpp
index 016b74b..9af0eb8 100644
--- a/interrupt/fault.cpp
+++ b/interrupt/fault.cpp
@@ -12,7 +12,11 @@ inline void __attribute__((naked)) switch_context() {
asm volatile ("str sp, [%0]" :: "r" (&Thread::active_thread->sp));
// Update running thread.
- Thread::active_thread = Thread::active_thread->next;
+ if(!Thread::reschedule()) {
+ // TODO: Set SLEEPONEXIT
+ } else {
+ // TODO: Clear SLEEPONEXIT
+ }
// Fetch stack pointer for new thread.
asm volatile ("ldr sp, [%0]" :: "r" (&Thread::active_thread->sp));