diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-07-21 15:03:31 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-07-21 15:03:31 +0000 |
commit | fdd9de8001b9edbbe57ecf6de015cb3f1f5b27ad (patch) | |
tree | d6f21a8c1ead8f004f96e616bea2c59f6473f5e7 /c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | |
parent | 2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-fdd9de8001b9edbbe57ecf6de015cb3f1f5b27ad.tar.bz2 |
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1799/bsps
* new-exceptions/bspsupport/ppc_exc_async_normal.S: New file.
* new-exceptions/cpu.c, new-exceptions/cpu_asm.S,
new-exceptions/bspsupport/ppc_exc_asm_macros.h,
new-exceptions/bspsupport/ppc_exc_global_handler.c,
new-exceptions/bspsupport/ppc_exc_prologue.c,
new-exceptions/bspsupport/vectors.h: Added support for SPE.
* configure.ac, preinstall.am, Makefile.am: Added support for qoriq
BSPs.
Diffstat (limited to 'c/src/lib/libcpu/powerpc/new-exceptions/cpu.c')
-rw-r--r-- | c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c index c1106ed910..9761adbc2b 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c +++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c @@ -28,6 +28,8 @@ * $Id$ */ +#include <string.h> + #include <rtems/system.h> #include <rtems/score/isr.h> #include <rtems/score/context.h> @@ -73,7 +75,6 @@ void _CPU_Context_Initialize( sp &= ~(CPU_STACK_ALIGNMENT-1); *((uint32_t*)sp) = 0; - the_context->gpr1 = sp; _CPU_MSR_GET( msr_value ); @@ -97,8 +98,6 @@ void _CPU_Context_Initialize( msr_value &= ~ppc_interrupt_get_disable_mask(); } - the_context->msr = msr_value; - /* * The FP bit of the MSR should only be enabled if this is a floating * point task. Unfortunately, the vfprintf_r routine in newlib @@ -119,12 +118,17 @@ void _CPU_Context_Initialize( * only way...) */ if ( is_fp ) - the_context->msr |= PPC_MSR_FP; + msr_value |= PPC_MSR_FP; else - the_context->msr &= ~PPC_MSR_FP; + msr_value &= ~PPC_MSR_FP; + + memset( the_context, 0, sizeof( *the_context ) ); - the_context->pc = (uint32_t)entry_point; + PPC_CONTEXT_SET_SP( the_context, sp ); + PPC_CONTEXT_SET_PC( the_context, (uint32_t) entry_point ); + PPC_CONTEXT_SET_MSR( the_context, msr_value ); +#ifndef __SPE__ #if (PPC_ABI == PPC_ABI_SVR4) /* * SVR4 says R2 is for 'system-reserved' use; it cannot hurt to @@ -148,6 +152,7 @@ void _CPU_Context_Initialize( #else #error unsupported PPC_ABI #endif +#endif /* __SPE__ */ #ifdef __ALTIVEC__ _CPU_Context_initialize_altivec(the_context); |