From 6d54d6c0884fb7aadbaecb41a86adf8c328e05e9 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 26 Aug 2005 22:52:31 +0000 Subject: SH1: Tiny optimisation of the thread scheduler. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7406 a1c6a512-1295-4272-9138-f99709370657 --- firmware/thread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'firmware') 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 @@ #include #include "thread.h" #include "panic.h" +#include "system.h" #include "kernel.h" #include "cpu.h" @@ -196,7 +197,7 @@ static inline void load_context(const void* addr) #endif -/*--------------------------------------------------------------------------- +/*--------------------------------------------------------------------------- * Switch thread in round robin fashion. *--------------------------------------------------------------------------- */ @@ -215,7 +216,7 @@ void switch_thread(void) #ifdef CPU_COLDFIRE asm volatile ("stop #0x2000"); #elif CONFIG_CPU == SH7034 - SBYCR &= 0x7F; + and_b(0x7F, &SBYCR); asm volatile ("sleep"); #elif CONFIG_CPU == TCC730 /* Sleep mode is triggered by the SYS instr on CalmRisc16. @@ -357,4 +358,4 @@ int thread_stack_usage(int threadnum) return ((thread_stack_size[threadnum] - i * sizeof(int)) * 100) / thread_stack_size[threadnum]; -} +} -- cgit