From 1836971d5152b44e905c4b6ed0e641e6d4f361fb Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Sat, 22 Mar 2008 13:18:47 +0000 Subject: Implement core_sleep() for TCC780x (single core). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16740 a1c6a512-1295-4272-9138-f99709370657 --- firmware/thread.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'firmware') 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) { -- cgit v1.2.3