diff --git a/firmware/SOURCES b/firmware/SOURCES
index a592ad1..3f63730 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -37,7 +37,9 @@ target/hosted/sdl/lcd-remote-bitmap.c
 #endif
 target/hosted/sdl/lcd-sdl.c
 target/hosted/sdl/system-sdl.c
+#if ((CONFIG_PLATFORM & PLATFORM_MAEMO) == 0)
 target/hosted/sdl/thread-sdl.c
+#endif
 target/hosted/sdl/timer-sdl.c
 #ifdef HAVE_TOUCHSCREEN
 target/hosted/sdl/key_to_touch-sdl.c
diff --git a/firmware/target/hosted/maemo/thread-maemo-arm.c b/firmware/target/hosted/maemo/thread-maemo-arm.c
new file mode 100644
index 0000000..0bfd2b6
--- /dev/null
+++ b/firmware/target/hosted/maemo/thread-maemo-arm.c
@@ -0,0 +1,98 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (C) 2005 by Thom Johansen
+ * Copyright (C) 2010 by Thomas Martitz (Android-suitable core_sleep())
+ *
+ * Generic ARM threading support
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <jni.h>
+#include <system.h>
+/*---------------------------------------------------------------------------
+ * Start the thread running and terminate it if it returns
+ *---------------------------------------------------------------------------
+ */
+static void __attribute__((naked,used)) start_thread(void)
+{
+    /* r0 = context */
+    asm volatile (
+        "ldr    sp, [r0, #32]            \n" /* Load initial sp */
+        "ldr    r4, [r0, #40]            \n" /* start in r4 since it's non-volatile */
+        "mov    r1, #0                   \n" /* Mark thread as running */
+        "str    r1, [r0, #40]            \n"
+        "mov    lr, pc                   \n" /* Call thread function */
+        "bx     r4                       \n"
+    ); /* No clobber list - new thread doesn't care */
+    thread_exit();
+}
+
+/* For startup, place context pointer in r4 slot, start_thread pointer in r5
+ * slot, and thread function pointer in context.start. See load_context for
+ * what happens when thread is initially going to run. */
+#define THREAD_STARTUP_INIT(core, thread, function) \
+    ({ (thread)->context.r[0] = (uint32_t)&(thread)->context,  \
+       (thread)->context.r[1] = (uint32_t)start_thread, \
+       (thread)->context.start = (uint32_t)function; })
+
+
+/*---------------------------------------------------------------------------
+ * Store non-volatile context.
+ *---------------------------------------------------------------------------
+ */
+static inline void store_context(void* addr)
+{
+    asm volatile(
+        "stmia  %0, { r4-r11, sp, lr } \n"
+        : : "r" (addr)
+    );
+}
+
+/*---------------------------------------------------------------------------
+ * Load non-volatile context.
+ *---------------------------------------------------------------------------
+ */
+static inline void load_context(const void* addr)
+{
+    asm volatile(
+        "ldr     r0, [%0, #40]          \n" /* Load start pointer */
+        "cmp     r0, #0                 \n" /* Check for NULL */
+
+        /* If not already running, jump to start */
+        "ldmneia %0, { r0, pc }         \n"
+        "ldmia   %0, { r4-r11, sp, lr } \n" /* Load regs r4 to r14 from context */
+        : : "r" (addr) : "r0" /* only! */
+    );
+}
+
+/*
+ * this core sleep suspends the OS thread rockbox runs under, which greatly
+ * reduces cpu usage (~100% to <10%)
+ *
+ * it returns when the RockboxTimer notified us, i.e. at each tick
+ * (after it called the tick tasks)
+ *
+ * wait_for_interrupt is implemented in kernel-android.c
+ **/
+
+static inline void core_sleep(void)
+{
+    wait_for_interrupt();
+}
+
+
diff --git a/firmware/target/hosted/sdl/kernel-sdl.c b/firmware/target/hosted/sdl/kernel-sdl.c
index c4d4ee2..15934ee 100644
--- a/firmware/target/hosted/sdl/kernel-sdl.c
+++ b/firmware/target/hosted/sdl/kernel-sdl.c
@@ -34,6 +34,12 @@
 static SDL_TimerID tick_timer_id;
 long start_tick;

+#ifndef HAVE_SDL_THREADS
+/* for the wait_for_interrupt function */
+static bool do_exit;
+static SDL_cond *wfi_cond;
+static SDL_mutex *wfi_mutex;
+#endif
 /* Condition to signal that "interrupts" may proceed */
 static SDL_cond *sim_thread_cond;
 /* Mutex to serialize changing levels and exclude other threads while
@@ -89,6 +95,9 @@ void sim_exit_irq_handler(void)

     status_reg = 0;
     SDL_UnlockMutex(sim_irq_mtx);
+#ifndef HAVE_SDL_THREADS
+    SDL_CondSignal(wfi_cond);
+#endif
 }

 static bool sim_kernel_init(void)
@@ -106,15 +115,33 @@ static bool sim_kernel_init(void)
         panicf("Cannot create sim_thread_cond\n");
         return false;
     }
-
+#ifndef HAVE_SDL_THREADS
+    wfi_cond = SDL_CreateCond();
+    if (wfi_cond == NULL)
+    {
+        panicf("Cannot create wfi\n");
+        return false;
+    }
+    wfi_mutex = SDL_CreateMutex();
+    if (wfi_mutex == NULL)
+    {
+        panicf("Cannot create wfi mutex\n");
+        return false;
+    }
+#endif
     return true;
 }

 void sim_kernel_shutdown(void)
 {
+    disable_irq();
     SDL_RemoveTimer(tick_timer_id);
     SDL_DestroyMutex(sim_irq_mtx);
     SDL_DestroyCond(sim_thread_cond);
+#ifndef HAVE_SDL_THREADS
+    do_exit = true;
+    SDL_CondSignal(wfi_cond);
+#endif
 }

 Uint32 tick_timer(Uint32 interval, void *param)
@@ -159,4 +186,21 @@ void tick_start(unsigned int interval_in_ms)
     }

     tick_timer_id = SDL_AddTimer(interval_in_ms, tick_timer, NULL);
+#ifndef HAVE_SDL_THREADS
+    SDL_LockMutex(wfi_mutex);
+#endif
+}
+
+#ifndef HAVE_SDL_THREADS
+void wait_for_interrupt(void)
+{
+    SDL_CondWait(wfi_cond, wfi_mutex);
+    if (UNLIKELY(do_exit))
+    {
+        SDL_DestroyCond(wfi_cond);
+        SDL_UnlockMutex(wfi_mutex);
+        SDL_DestroyMutex(wfi_mutex);
+        sim_do_exit();
+    }
 }
+#endif
diff --git a/firmware/thread.c b/firmware/thread.c
index 655af1a..84370b7 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -178,6 +178,8 @@ void switch_thread(void)
  */
 #if defined(ANDROID)
 #include "thread-android-arm.c"
+#elif (CONFIG_PLATFORM & PLATFORM_MAEMO)
+#include "thread-maemo-arm.c"
 #elif defined(CPU_ARM)
 #include "thread-arm.c"
 #if defined (CPU_PP)