diff --git a/arch/arm/cpu/interrupts.c b/arch/arm/cpu/interrupts.c index 3d2077f..c4f9113 100644 --- a/arch/arm/cpu/interrupts.c +++ b/arch/arm/cpu/interrupts.c @@ -73,6 +73,11 @@ #endif } +void dump_stack(void) +{ + unwind_backtrace(NULL); +} + static void __noreturn do_exception(struct pt_regs *pt_regs) { show_regs(pt_regs); diff --git a/arch/arm/include/asm/barebox.h b/arch/arm/include/asm/barebox.h index c9372da..2b08d68 100644 --- a/arch/arm/include/asm/barebox.h +++ b/arch/arm/include/asm/barebox.h @@ -1,41 +1,8 @@ -/* - * (C) Copyright 2002 - * Sysgo Real-Time Solutions, GmbH - * Marius Groeger - * - * (C) Copyright 2002 - * Sysgo Real-Time Solutions, GmbH - * Alex Zuepke - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ******************************************************************** - * NOTE: This header file defines an interface to barebox. Including - * this (unmodified) header file in another file is considered normal - * use of barebox, and does *not* fall under the heading of "derived - * work". - ******************************************************************** - */ - #ifndef _BAREBOX_H_ #define _BAREBOX_H_ 1 -//typedef struct bd_info {} bd_t; +#ifdef CONFIG_ARM_UNWIND +#define ARCH_HAS_STACK_DUMP +#endif #endif /* _BAREBOX_H_ */ diff --git a/include/common.h b/include/common.h index 2f37dd8..74a697d 100644 --- a/include/common.h +++ b/include/common.h @@ -119,6 +119,15 @@ /* common/console.c */ int ctrlc (void); +#ifdef ARCH_HAS_STACK_DUMP +void dump_stack(void); +#else +static inline void dump_stack(void) +{ + printf("no stack data available\n"); +} +#endif + #define MEMAREA_SIZE_SPECIFIED 1 struct memarea_info { diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 4165f97..9763515 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -625,6 +625,8 @@ putchar('\n'); va_end(args); + dump_stack(); + led_trigger(LED_TRIGGER_PANIC, TRIGGER_ENABLE); #if defined (CONFIG_PANIC_HANG)