summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-13 00:15:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-13 00:15:08 +0000
commit15b4c567c5a1fc40aa6d9de04cc5becc32df3641 (patch)
tree50145e6635af5197777618c2c54b9d9593ef0f90
parent605bc460d02638bb5321af77e80d169f8807176f (diff)
downloadnuttx-15b4c567c5a1fc40aa6d9de04cc5becc32df3641.tar.gz
nuttx-15b4c567c5a1fc40aa6d9de04cc5becc32df3641.tar.bz2
nuttx-15b4c567c5a1fc40aa6d9de04cc5becc32df3641.zip
No need to restore r8-r14 on return from int if no context switch
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1213 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/sh/src/sh1/sh1_vector.S21
1 files changed, 16 insertions, 5 deletions
diff --git a/nuttx/arch/sh/src/sh1/sh1_vector.S b/nuttx/arch/sh/src/sh1/sh1_vector.S
index 3e6a32029..9e7ef5075 100644
--- a/nuttx/arch/sh/src/sh1/sh1_vector.S
+++ b/nuttx/arch/sh/src/sh1/sh1_vector.S
@@ -345,7 +345,7 @@ _up_vector:
mov.l .Ldoirq, r0
jsr @r0
- mov r15, r14
+ nop
/* Recover the user stack point */
@@ -355,7 +355,7 @@ _up_vector:
mov.l .Ldoirq, r0
jsr @r0
- mov r15, r14
+ nop
#endif
/* On return, R0 holds the address of the base of the XCPTCONTEXT
* structure to use for the return -- may not be the same as the
@@ -368,17 +368,28 @@ _up_vector:
bf .Lcontextswitch
mov r0, r15
- /* Restore registers from the stack. */
+ /* Restore registers from the stack. NOTE: We coudl improve interrupt
+ * performance by skipping the restore of r8-r14. These will not
+ * be modified by the called C code
+ */
- mov.l @r15+, r8 /* 0-8: r8-r14, pr, and gbr */
+#if 1
+ /* Skip over static registers -- these will not be modified by the
+ * called C code (r8-r14)
+ */
+
+ add #(7*4), r15 /* 0-6: Skip over r8-r14 */
+#else
+ mov.l @r15+, r8 /* 0-6: r8-r14 */
mov.l @r15+, r9
mov.l @r15+, r10
mov.l @r15+, r11
mov.l @r15+, r12
mov.l @r15+, r13
mov.l @r15+, r14
+#endif
- lds.l @r15+, pr
+ lds.l @r15+, pr /* 7-8: pr and gbr */
ldc.l @r15+, gbr
add #4, r15 /* 9: Skip SP restore */