summaryrefslogtreecommitdiff
path: root/firmware/thread.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-02-05 04:43:19 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-02-05 04:43:19 +0000
commit1f021af60cd0351a309666c2e32b3d1b8b2cbd6f (patch)
tree88710bcc59d80831327b00d59af0eb6a6f758de6 /firmware/thread.c
parent3f85a4bc97fb2120870fcd4a6650fd72d4a6338f (diff)
downloadrockbox-1f021af60cd0351a309666c2e32b3d1b8b2cbd6f.zip
rockbox-1f021af60cd0351a309666c2e32b3d1b8b2cbd6f.tar.gz
rockbox-1f021af60cd0351a309666c2e32b3d1b8b2cbd6f.tar.bz2
rockbox-1f021af60cd0351a309666c2e32b3d1b8b2cbd6f.tar.xz
Gigabeat S mixer: Make some progress. Get the tick and core sleep working using the AVIC. Redo the startup code to remap from IRAM and not include the lcd driver frambuffer in the remapping (until it can be moved). Clean up LCD driver. For other misc. changes, see the diffs. Now it progresses to ATA init and fails with -11 but without crashing or hanging. Replace all bootloaders.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16216 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/thread.c')
-rw-r--r--firmware/thread.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index fdef2cd..41160a0 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -750,6 +750,18 @@ static inline void core_sleep(void)
{
#warning TODO: Implement core_sleep
}
+#elif CONFIG_CPU == IMX31L
+static inline void core_sleep(void)
+{
+ 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"
+ );
+}
#else
static inline void core_sleep(void)
{
@@ -2542,6 +2554,9 @@ void init_threads(void)
struct thread_entry *thread;
int slot;
+ memset(threads, 0, sizeof(threads));
+ memset(cores, 0, sizeof(cores));
+
/* CPU will initialize first and then sleep */
slot = find_empty_thread_slot();