[uClinux-dev] [PATCH] coldfire context switch speedup
Philippe De Muyter
phdm at macqel.be
Thu Mar 22 08:49:43 EST 2007
Hi Greg,
It is useless to preserve THREAD_SR in `resume'. The real user's sr
is actually in the stack. We also don't need to disable interrupts :
we'll never be in an invalid state, the sp switch is atomic.
Signed-off-by: Philippe De Muyter <phdm at macqel.be>
diff -r f8b279fd0eab arch/m68knommu/platform/5307/entry.S
--- a/arch/m68knommu/platform/5307/entry.S Mon Mar 19 20:20:56 2007 -0700
+++ b/arch/m68knommu/platform/5307/entry.S Thu Mar 22 13:43:39 2007 +0100
@@ -235,16 +235,12 @@ 2:
* Beware - when entering resume, prev (the current task) is
* in a0, next (the new task) is in a1,so don't change these
* registers until their contents are no longer needed.
+ * This is always called in supervisor mode, so don't bother to save
+ * and restore sr; user's process sr is actually in the stack.
*/
ENTRY(resume)
movel %a0, %d1 /* get prev thread in d1 */
- movew %sr,%d0 /* save thread status reg */
- movew %d0,%a0@(TASK_THREAD+THREAD_SR)
-
- oril #0x700,%d0 /* disable interrupts */
- move %d0,%sr
-
movel sw_usp,%d0 /* save usp */
movel %d0,%a0@(TASK_THREAD+THREAD_USP)
@@ -255,7 +251,4 @@ ENTRY(resume)
movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */
movel %a0, sw_usp
-
- movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */
- movew %d0, %sr
rts
More information about the uClinux-dev
mailing list