summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sh/cpu.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-12 17:40:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-12 17:40:22 +0000
commitbc5fc7a6f4623848fabba8dcb325db3d731d9f4a (patch)
tree51aba724614e1872e7d272215ed64ebb72564514 /cpukit/score/cpu/sh/cpu.c
parentf64f18160cab2dce5296ca38e8329e0fb80ac991 (diff)
downloadrtems-bc5fc7a6f4623848fabba8dcb325db3d731d9f4a.tar.bz2
2001-10-12 Alexandra Kossovsky <sasha@oktet.ru>
* cpu.c, rtems/score/cpu.h, rtems/score/sh.h: Modified to support SH4. Reviewed by Ralf Corsepius <corsepiu@faw.uni-ulm.de> who did the original SH port.
Diffstat (limited to 'cpukit/score/cpu/sh/cpu.c')
-rw-r--r--cpukit/score/cpu/sh/cpu.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpukit/score/cpu/sh/cpu.c b/cpukit/score/cpu/sh/cpu.c
index eaebb46ac7..b63be7c4c2 100644
--- a/cpukit/score/cpu/sh/cpu.c
+++ b/cpukit/score/cpu/sh/cpu.c
@@ -29,6 +29,10 @@
#include <rtems/score/cpu.h>
#include <rtems/score/sh.h>
+/* FIXME: This should not be here */
+#if defined(__SH4__)
+#include <rtems/score/sh4_regs.h>
+#endif
/* referenced in start.S */
extern proc_ptr vectab[] ;
@@ -75,6 +79,14 @@ void _CPU_Initialize(
*/
/* FP context initialization support goes here */
+ /* FIXME: When not to use SH4_FPSCR_PR ? */
+#ifdef __SH4__
+ _CPU_Null_fp_context.fpscr = SH4_FPSCR_DN | SH4_FPSCR_RM | SH4_FPSCR_PR;
+#endif
+#ifdef __SH3E__
+ /* FIXME: Wild guess :) */
+ _CPU_Null_fp_context.fpscr = SH4_FPSCR_DN | SH4_FPSCR_RM;
+#endif
_CPU_Table = *cpu_table;
@@ -151,6 +163,7 @@ void _CPU_ISR_install_raw_handler(
*
*/
+#if defined(sh1) || defined(sh2)
void _CPU_ISR_install_vector(
unsigned32 vector,
proc_ptr new_handler,
@@ -230,6 +243,18 @@ void _CPU_Context_Initialize(
int _is_fp )
{
_the_context->r15 = (unsigned32*) ((unsigned32) (_stack_base) + (_size) );
+#if defined(__sh1__) || defined(__sh2__)
_the_context->sr = (_isr << 4) & 0x00f0 ;
+#else
+ _the_context->sr = SH4_SR_MD | ((_isr << 4) & 0x00f0);
+#endif
_the_context->pr = (unsigned32*) _entry_point ;
+
+
+#if 0 && SH_HAS_FPU
+ /* Disable FPU if it is non-fp task */
+ if(!_is_fp)
+ _the_context->sr |= SH4_SR_FD;
+#endif
}
+