From 2f28a03b5c0e8d29b3f3427cc62f35b32103901c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 7 Jan 2013 13:42:09 +0100 Subject: 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(-) delete mode 100644 cpukit/score/cpu/arm/armv7m-exception-frame-print.c diff --git a/cpukit/score/cpu/arm/Makefile.am b/cpukit/score/cpu/arm/Makefile.am index dedbb049b4..56a5fdd465 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 4d89f69f76..53d31adb73 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 - -#ifdef ARM_MULTILIB_ARCH_V4 +#include 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 86931b2b24..0000000000 --- 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 - * - * - * 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 - -#ifdef ARM_MULTILIB_ARCH_V7M - -void _CPU_Exception_frame_print( const CPU_Exception_frame *frame ) -{ - /* TODO */ -} - -#endif /* ARM_MULTILIB_ARCH_V7M */ -- cgit v1.2.3