summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m32c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-10-13 17:07:57 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-10-13 17:07:57 +0000
commitf517be08f1f2ee6c54603267c4a6dcfffa1c21a4 (patch)
treee39eb94d1764e8c153703c772f87b1c20d14c4ec /cpukit/score/cpu/m32c
parent2008-10-13 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-f517be08f1f2ee6c54603267c4a6dcfffa1c21a4.tar.bz2
2008-10-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* context_switch.S, cpu_asm.c, rtems/score/cpu.h: Add support for restarting the currently executing thread. Fine tune alignment factor as two-byte aligned and use this for critical structures.
Diffstat (limited to 'cpukit/score/cpu/m32c')
-rw-r--r--cpukit/score/cpu/m32c/ChangeLog6
-rw-r--r--cpukit/score/cpu/m32c/context_switch.S10
-rw-r--r--cpukit/score/cpu/m32c/cpu_asm.c2
-rw-r--r--cpukit/score/cpu/m32c/rtems/score/cpu.h10
4 files changed, 24 insertions, 4 deletions
diff --git a/cpukit/score/cpu/m32c/ChangeLog b/cpukit/score/cpu/m32c/ChangeLog
index 7709e95da3..52c968453b 100644
--- a/cpukit/score/cpu/m32c/ChangeLog
+++ b/cpukit/score/cpu/m32c/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-13 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * context_switch.S, cpu_asm.c, rtems/score/cpu.h: Add support for
+ restarting the currently executing thread. Fine tune alignment factor
+ as two-byte aligned and use this for critical structures.
+
2008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* .cvsignore, ChangeLog, Makefile.am, context_init.c, context_switch.S,
diff --git a/cpukit/score/cpu/m32c/context_switch.S b/cpukit/score/cpu/m32c/context_switch.S
index c430cd6705..39d151bd98 100644
--- a/cpukit/score/cpu/m32c/context_switch.S
+++ b/cpukit/score/cpu/m32c/context_switch.S
@@ -28,6 +28,7 @@ __CPU_Context_switch:
mov.l ARG_HEIR[fb],a0 ; a0 = heir
+restore:
mov.l CTXT_SP[a0],a1
ldc a1,sp ; restore sp
mov.l CTXT_FB[a0],a1
@@ -37,3 +38,12 @@ __CPU_Context_switch:
popm a0,a1,r0,r1,r2,r3
exitd
.size __CPU_Context_switch, .-__CPU_Context_switch
+
+#define ARG_RESTART 8
+
+ .global __CPU_Context_Restart_self
+ .type __CPU_Context_Restart_self, @function
+__CPU_Context_Restart_self:
+ enter #0
+ mov.l ARG_RESTART[fb],a0 ; a0 = heir
+ jmp.s restore
diff --git a/cpukit/score/cpu/m32c/cpu_asm.c b/cpukit/score/cpu/m32c/cpu_asm.c
index 4eb7b5f7d8..3f998faf93 100644
--- a/cpukit/score/cpu/m32c/cpu_asm.c
+++ b/cpukit/score/cpu/m32c/cpu_asm.c
@@ -26,11 +26,13 @@
#include <rtems/score/cpu.h>
/* #include "cpu_asm.h> */
+#if 0
void _CPU_Context_restore(
Context_Control *new_context
)
{
}
+#endif
/* void __ISR_Handler()
*
diff --git a/cpukit/score/cpu/m32c/rtems/score/cpu.h b/cpukit/score/cpu/m32c/rtems/score/cpu.h
index e7de8faa96..c66da04852 100644
--- a/cpukit/score/cpu/m32c/rtems/score/cpu.h
+++ b/cpukit/score/cpu/m32c/rtems/score/cpu.h
@@ -357,7 +357,8 @@ extern "C" {
*
* XXX document implementation including references if appropriate
*/
-#define CPU_STRUCTURE_ALIGNMENT
+#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (2)))
+
/**
* @defgroup CPUEndian Processor Dependent Endianness Support
@@ -597,7 +598,7 @@ SCORE_EXTERN void *_CPU_Interrupt_stack_high;
*
* XXX document implementation including references if appropriate
*/
-#define CPU_ALIGNMENT 8
+#define CPU_ALIGNMENT 2
/**
* This number corresponds to the byte alignment requirement for the
@@ -823,8 +824,9 @@ void _CPU_Context_Initialize(
*
* XXX document implementation including references if appropriate
*/
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
+void _CPU_Context_Restart_self(
+ Context_Control *the_context
+);
/**
* @ingroup CPUContext