summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-12-27 10:22:39 +0000
committerNils Wallménius <nils@rockbox.org>2010-12-27 10:22:39 +0000
commitb8bf7cb5edfbff1b440bb749d55c353a9fa081f7 (patch)
tree1e622b9f1dd58c5c806a318527fd3416a50bb823
parent7b4eb44395bced7073e37d0b8b0d83fb2f518482 (diff)
downloadrockbox-b8bf7cb5edfbff1b440bb749d55c353a9fa081f7.tar.gz
rockbox-b8bf7cb5edfbff1b440bb749d55c353a9fa081f7.zip
Move codfire inline asm into cpu specific file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28910 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/thread-coldfire.c14
-rw-r--r--firmware/thread.c9
2 files changed, 15 insertions, 8 deletions
diff --git a/firmware/target/coldfire/thread-coldfire.c b/firmware/target/coldfire/thread-coldfire.c
index f151a971c7..c94580a4e7 100644
--- a/firmware/target/coldfire/thread-coldfire.c
+++ b/firmware/target/coldfire/thread-coldfire.c
@@ -95,3 +95,17 @@ static inline void core_sleep(void)
95 /* Supervisor mode, interrupts enabled upon wakeup */ 95 /* Supervisor mode, interrupts enabled upon wakeup */
96 asm volatile ("stop #0x2000"); 96 asm volatile ("stop #0x2000");
97}; 97};
98
99/*---------------------------------------------------------------------------
100 * Call this from asm to make sure the sp is pointing to the
101 * correct place before the context is saved.
102 *---------------------------------------------------------------------------
103 */
104static inline void _profile_thread_stopped(int current_thread)
105{
106 asm volatile ("move.l %[id], -(%%sp)\n\t"
107 "jsr profile_thread_stopped\n\t"
108 "addq.l #4, %%sp\n\t"
109 :: [id] "r" (current_thread)
110 : "cc", "memory");
111}
diff --git a/firmware/thread.c b/firmware/thread.c
index 91fe81be4a..6cd4d33c6e 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -1150,14 +1150,7 @@ void switch_thread(void)
1150 1150
1151#ifdef RB_PROFILE 1151#ifdef RB_PROFILE
1152#ifdef CPU_COLDFIRE 1152#ifdef CPU_COLDFIRE
1153 /* Call this from asm to make sure the sp is pointing to the 1153 _profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK);
1154 correct place before the context is saved */
1155 uint16_t id = thread->id & THREAD_ID_SLOT_MASK;
1156 asm volatile ("move.l %[id], -(%%sp)\n\t"
1157 "jsr profile_thread_stopped\n\t"
1158 "addq.l #4, %%sp\n\t"
1159 :: [id] "r" (id)
1160 : "cc", "memory");
1161#else 1154#else
1162 profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK); 1155 profile_thread_stopped(thread->id & THREAD_ID_SLOT_MASK);
1163#endif 1156#endif