diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-01-26 12:26:22 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-01-26 14:12:08 +0100 |
commit | 79c2f03aeed7b232592495f6af5fd94fbd102d25 (patch) | |
tree | 6ae59701dd9b70a838da5bf97745ee61fb316b26 /include/common.h | |
parent | 641dfaa3a8a7c0b5cb2ba9fa8943ea2ff680e70f (diff) | |
download | barebox-79c2f03aeed7b232592495f6af5fd94fbd102d25.tar.gz barebox-79c2f03aeed7b232592495f6af5fd94fbd102d25.tar.xz |
Add dump_stack function
At least ARM allows us to dump the stack, but we currently
have no prototype for this. Add a dump_stack prototype and
provide a static inline function for architectures without
stack dump support. Also, call dump_stack() in panic() to
provide more information in the case of a panic.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index 2f37dd845f..74a697d141 100644 --- a/include/common.h +++ b/include/common.h @@ -119,6 +119,15 @@ uint32_t crc32_no_comp(uint32_t, const void*, unsigned int); /* 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 { |