[rtems commit] arm: Implement CPU_Exception_frame_print()

Sebastian Huber sebh at rtems.org
Mon Jan 7 14:05:04 UTC 2013


Module:    rtems
Branch:    master
Commit:    2f28a03b5c0e8d29b3f3427cc62f35b32103901c
Changeset: http://git.rtems.org/rtems/commit/?id=2f28a03b5c0e8d29b3f3427cc62f35b32103901c

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jan  7 13:42:09 2013 +0100

arm: Implement CPU_Exception_frame_print()

---

 cpukit/score/cpu/arm/Makefile.am                   |    1 -
 cpukit/score/cpu/arm/arm-exception-frame-print.c   |   46 +++++++++++++++++---
 .../score/cpu/arm/armv7m-exception-frame-print.c   |   28 ------------
 3 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/cpukit/score/cpu/arm/Makefile.am b/cpukit/score/cpu/arm/Makefile.am
index dedbb04..56a5fdd 100644
--- a/cpukit/score/cpu/arm/Makefile.am
+++ b/cpukit/score/cpu/arm/Makefile.am
@@ -26,7 +26,6 @@ libscorecpu_a_SOURCES += armv7m-context-initialize.c
 libscorecpu_a_SOURCES += armv7m-context-restore.c
 libscorecpu_a_SOURCES += armv7m-context-switch.c
 libscorecpu_a_SOURCES += armv7m-exception-default.c
-libscorecpu_a_SOURCES += armv7m-exception-frame-print.c
 libscorecpu_a_SOURCES += armv7m-exception-handler-get.c
 libscorecpu_a_SOURCES += armv7m-exception-handler-set.c
 libscorecpu_a_SOURCES += armv7m-exception-priority-get.c
diff --git a/cpukit/score/cpu/arm/arm-exception-frame-print.c b/cpukit/score/cpu/arm/arm-exception-frame-print.c
index 4d89f69..53d31ad 100644
--- a/cpukit/score/cpu/arm/arm-exception-frame-print.c
+++ b/cpukit/score/cpu/arm/arm-exception-frame-print.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2012-2013 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Obere Lagerstr. 30
@@ -17,12 +17,46 @@
 #endif
 
 #include <rtems/score/cpu.h>
-
-#ifdef ARM_MULTILIB_ARCH_V4
+#include <rtems/bspIo.h>
 
 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
 {
-  /* TODO */
+  printk(
+    "\n"
+    "R0   = 0x%08x R8  = 0x%08x\n"
+    "R1   = 0x%08x R9  = 0x%08x\n"
+    "R2   = 0x%08x R10 = 0x%08x\n"
+    "R3   = 0x%08x R11 = 0x%08x\n"
+    "R4   = 0x%08x R12 = 0x%08x\n"
+    "R5   = 0x%08x SP  = 0x%08x\n"
+    "R6   = 0x%08x LR  = 0x%08x\n"
+    "R7   = 0x%08x PC  = 0x%08x\n"
+#if defined(ARM_MULTILIB_ARCH_V4)
+    "CPSR = 0x%08x VEC = 0x%08x\n",
+#elif defined(ARM_MULTILIB_ARCH_V7M)
+    "XPSR = 0x%08x VEC = 0x%08x\n",
+#endif
+    frame->register_r0,
+    frame->register_r1,
+    frame->register_r2,
+    frame->register_r3,
+    frame->register_r4,
+    frame->register_r5,
+    frame->register_r6,
+    frame->register_r7,
+    frame->register_r8,
+    frame->register_r9,
+    frame->register_r10,
+    frame->register_r11,
+    frame->register_r12,
+    frame->register_sp,
+    frame->register_lr,
+    frame->register_pc,
+#if defined(ARM_MULTILIB_ARCH_V4)
+    frame->register_cpsr,
+#elif defined(ARM_MULTILIB_ARCH_V7M)
+    frame->register_xpsr,
+#endif
+    frame->vector
+  );
 }
-
-#endif /* ARM_MULTILIB_ARCH_V4 */
diff --git a/cpukit/score/cpu/arm/armv7m-exception-frame-print.c b/cpukit/score/cpu/arm/armv7m-exception-frame-print.c
deleted file mode 100644
index 86931b2..0000000
--- a/cpukit/score/cpu/arm/armv7m-exception-frame-print.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
- *
- *  embedded brains GmbH
- *  Obere Lagerstr. 30
- *  82178 Puchheim
- *  Germany
- *  <rtems at embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-  #include "config.h"
-#endif
-
-#include <rtems/score/cpu.h>
-
-#ifdef ARM_MULTILIB_ARCH_V7M
-
-void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
-{
-  /* TODO */
-}
-
-#endif /* ARM_MULTILIB_ARCH_V7M */




More information about the vc mailing list