diff options
Diffstat (limited to 'firmware/thread.c')
-rw-r--r-- | firmware/thread.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/thread.c b/firmware/thread.c index 8834666b54..a8c5ab752f 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <stdbool.h> | 20 | #include <stdbool.h> |
21 | #include "thread.h" | 21 | #include "thread.h" |
22 | #include "panic.h" | 22 | #include "panic.h" |
23 | #include "system.h" | ||
23 | #include "kernel.h" | 24 | #include "kernel.h" |
24 | #include "cpu.h" | 25 | #include "cpu.h" |
25 | 26 | ||
@@ -196,7 +197,7 @@ static inline void load_context(const void* addr) | |||
196 | 197 | ||
197 | #endif | 198 | #endif |
198 | 199 | ||
199 | /*--------------------------------------------------------------------------- | 200 | /*--------------------------------------------------------------------------- |
200 | * Switch thread in round robin fashion. | 201 | * Switch thread in round robin fashion. |
201 | *--------------------------------------------------------------------------- | 202 | *--------------------------------------------------------------------------- |
202 | */ | 203 | */ |
@@ -215,7 +216,7 @@ void switch_thread(void) | |||
215 | #ifdef CPU_COLDFIRE | 216 | #ifdef CPU_COLDFIRE |
216 | asm volatile ("stop #0x2000"); | 217 | asm volatile ("stop #0x2000"); |
217 | #elif CONFIG_CPU == SH7034 | 218 | #elif CONFIG_CPU == SH7034 |
218 | SBYCR &= 0x7F; | 219 | and_b(0x7F, &SBYCR); |
219 | asm volatile ("sleep"); | 220 | asm volatile ("sleep"); |
220 | #elif CONFIG_CPU == TCC730 | 221 | #elif CONFIG_CPU == TCC730 |
221 | /* Sleep mode is triggered by the SYS instr on CalmRisc16. | 222 | /* Sleep mode is triggered by the SYS instr on CalmRisc16. |
@@ -357,4 +358,4 @@ int thread_stack_usage(int threadnum) | |||
357 | 358 | ||
358 | return ((thread_stack_size[threadnum] - i * sizeof(int)) * 100) / | 359 | return ((thread_stack_size[threadnum] - i * sizeof(int)) * 100) / |
359 | thread_stack_size[threadnum]; | 360 | thread_stack_size[threadnum]; |
360 | } | 361 | } |