summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m32c/context_switch.S
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-10-02 21:32:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-10-02 21:32:44 +0000
commited6e94718057565c287a28d186d06816b74c65cf (patch)
tree7f83b4da2f2d9111ef37b266c892ebcd8373dc20 /cpukit/score/cpu/m32c/context_switch.S
parent2008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-ed6e94718057565c287a28d186d06816b74c65cf.tar.bz2
2008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* .cvsignore, ChangeLog, Makefile.am, context_init.c, context_switch.S, cpu.c, cpu_asm.c, preinstall.am, varvects.S, varvects.h, rtems/asm.h, rtems/score/cpu.h, rtems/score/cpu_asm.h, rtems/score/m32c.h, rtems/score/types.h: New files.
Diffstat (limited to 'cpukit/score/cpu/m32c/context_switch.S')
-rw-r--r--cpukit/score/cpu/m32c/context_switch.S39
1 files changed, 39 insertions, 0 deletions
diff --git a/cpukit/score/cpu/m32c/context_switch.S b/cpukit/score/cpu/m32c/context_switch.S
new file mode 100644
index 0000000000..c430cd6705
--- /dev/null
+++ b/cpukit/score/cpu/m32c/context_switch.S
@@ -0,0 +1,39 @@
+/*
+ * Context switch for the Reneas M32C
+ *
+ *
+ */
+
+#define ARG_EXECUTING 8
+#define ARG_HEIR 12
+
+#define CTXT_SP 0
+#define CTXT_FB 4
+
+ .file "context_switch.S"
+ .text
+ .global __CPU_Context_switch
+ .type __CPU_Context_switch, @function
+__CPU_Context_switch:
+ enter #0
+ pushm a0,a1,r0,r1,r2,r3
+ pushc flg
+ pushc sb
+
+ mov.l ARG_EXECUTING[fb],a0 ; a0 = executing
+ stc fb,a1
+ mov.l a1,CTXT_FB[a0] ; save fb
+ stc sp,a1
+ mov.l a1,CTXT_SP[a0] ; save sp
+
+ mov.l ARG_HEIR[fb],a0 ; a0 = heir
+
+ mov.l CTXT_SP[a0],a1
+ ldc a1,sp ; restore sp
+ mov.l CTXT_FB[a0],a1
+ ldc a1,fb ; restore fb
+ popc sb
+ popc flg
+ popm a0,a1,r0,r1,r2,r3
+ exitd
+ .size __CPU_Context_switch, .-__CPU_Context_switch