1
0
Fork 0
forked from len0rd/rockbox

Move codfire inline asm into cpu specific file.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28910 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2010-12-27 10:22:39 +00:00
parent 7b4eb44395
commit b8bf7cb5ed
2 changed files with 15 additions and 8 deletions

View file

@ -95,3 +95,17 @@ static inline void core_sleep(void)
/* Supervisor mode, interrupts enabled upon wakeup */ /* Supervisor mode, interrupts enabled upon wakeup */
asm volatile ("stop #0x2000"); asm volatile ("stop #0x2000");
}; };
/*---------------------------------------------------------------------------
* Call this from asm to make sure the sp is pointing to the
* correct place before the context is saved.
*---------------------------------------------------------------------------
*/
static inline void _profile_thread_stopped(int current_thread)
{
asm volatile ("move.l %[id], -(%%sp)\n\t"
"jsr profile_thread_stopped\n\t"
"addq.l #4, %%sp\n\t"
:: [id] "r" (current_thread)
: "cc", "memory");
}

View file

@ -1150,14 +1150,7 @@ void switch_thread(void)
#ifdef RB_PROFILE #ifdef RB_PROFILE
#ifdef CPU_COLDFIRE #ifdef CPU_COLDFIRE
/* Call this from asm to make sure the sp is pointing to the _profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK);
correct place before the context is saved */
uint16_t id = thread->id & THREAD_ID_SLOT_MASK;
asm volatile ("move.l %[id], -(%%sp)\n\t"
"jsr profile_thread_stopped\n\t"
"addq.l #4, %%sp\n\t"
:: [id] "r" (id)
: "cc", "memory");
#else #else
profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK); profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK);
#endif #endif