diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2008-03-22 13:18:47 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2008-03-22 13:18:47 +0000 |
commit | 1836971d5152b44e905c4b6ed0e641e6d4f361fb (patch) | |
tree | 82c4c1856339dc9763e880b888252696549af53d /firmware | |
parent | bc227c0aa2849e125d2eb00cd14660c56e966ae6 (diff) |
Implement core_sleep() for TCC780x (single core).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16740 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/thread.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/thread.c b/firmware/thread.c index d348f7439d..8bebfedbf5 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -758,6 +758,19 @@ static inline void core_sleep(void) { #warning TODO: Implement core_sleep } +#elif defined(CPU_TCC780X) +static inline void core_sleep(void) +{ + /* Single core only for now. Use the generic ARMv5 wait for IRQ */ + asm volatile ( + "mov r0, #0 \n" + "mcr p15, 0, r0, c7, c0, 4 \n" /* Wait for interrupt */ + "mrs r0, cpsr \n" /* Unmask IRQ/FIQ at core level */ + "bic r0, r0, #0xc0 \n" + "msr cpsr_c, r0 \n" + : : : "r0" + ); +} #elif CONFIG_CPU == IMX31L static inline void core_sleep(void) { |