summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-18 14:14:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-18 14:14:17 +0000
commitb077dc41ceeecc053792bc08961250272e6c9266 (patch)
tree6ce84b71418d808fbefe7c77da4188ce43a158a4
parent2001-01-18 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-b077dc41ceeecc053792bc08961250272e6c9266.tar.bz2
2002-01-18 Till Straumann <strauman@slac.stanford.edu>
* src/powerpc/excep_f.c: This patch addresses the following issues: - exception handler needs to enable MSR_FP if the interrupted thread is FP enabled. - printk message for MSR fixed and added stacktrace NOTE: this requires the stacktrace patch to lib/libbsp/powerpc/shared/vectors/vector_init.c (#ifdef DDEBUG only, however)
Diffstat (limited to '')
-rw-r--r--c/src/librdbg/ChangeLog11
-rw-r--r--c/src/librdbg/src/powerpc/excep_f.c19
2 files changed, 29 insertions, 1 deletions
diff --git a/c/src/librdbg/ChangeLog b/c/src/librdbg/ChangeLog
index c77ce790a6..ec9bd89597 100644
--- a/c/src/librdbg/ChangeLog
+++ b/c/src/librdbg/ChangeLog
@@ -1,3 +1,14 @@
+2002-01-18 Till Straumann <strauman@slac.stanford.edu>
+
+ * src/powerpc/excep_f.c: This patch addresses the following issues:
+ - exception handler needs to enable MSR_FP if the interrupted
+ thread is FP enabled.
+ - printk message for MSR fixed and added stacktrace
+
+ NOTE: this requires the stacktrace patch to
+ lib/libbsp/powerpc/shared/vectors/vector_init.c
+ (#ifdef DDEBUG only, however)
+
2001-01-18 Joel Sherrill <joel@OARcorp.com>
* src/powerpc/new_exception_processing/remdeb_svc.c: Corrected
diff --git a/c/src/librdbg/src/powerpc/excep_f.c b/c/src/librdbg/src/powerpc/excep_f.c
index 8580789b99..13adcd1e67 100644
--- a/c/src/librdbg/src/powerpc/excep_f.c
+++ b/c/src/librdbg/src/powerpc/excep_f.c
@@ -56,6 +56,18 @@ BreakPointExcHdl(CPU_Exception_frame *ctx)
rtems_status_code status;
rtems_id continueSemId;
+ /* T. Straumann, 1/16/2002: we must re-enable the floating point engine
+ * if the interrupted thread is FP. Otherwise,
+ * the semaphore primitives may crash when they
+ * try to save FP context while switching this
+ * thread...
+ */
+ if (ctx->EXC_SRR1 & 0x2000) {
+ register unsigned long msr;
+ __asm__ __volatile__("mfmsr %0":"=r"(msr));
+ __asm__ __volatile__("mtmsr %0"::"r"(msr|MSR_FP));
+ }
+
if ( (justSaveContext) && (ctx->_EXC_number == ASM_SYS_VECTOR) ) {
PushSavedExceptCtx (_Thread_Executing->Object.id, ctx);
justSaveContext = 0;
@@ -114,7 +126,7 @@ BreakPointExcHdl(CPU_Exception_frame *ctx)
printk("\t CTR = %x\n", ctx->EXC_CTR);
printk("\t XER = %x\n", ctx->EXC_XER);
printk("\t LR = %x\n", ctx->EXC_LR);
- printk("\t MSR = %x\n", ctx->EXC_MSR);
+ printk("\t MSR = %x\n", ctx->EXC_SRR1);
#endif
status = rtems_semaphore_create (rtems_build_name('D', 'B', 'G', 'c'),
@@ -151,6 +163,11 @@ BreakPointExcHdl(CPU_Exception_frame *ctx)
default:
DPRINTF((" OTHER EXCEPTION !!!\n"));
+#ifdef DDEBUG
+ { extern void BSP_printStackTrace();
+ BSP_printStackTrace(ctx);
+ }
+#endif
rtems_semaphore_release( wakeupEventSemId );
break;
}