summaryrefslogtreecommitdiff
path: root/cpu/blackfin/traps.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-05-20 04:35:14 -0400
committerWolfgang Denk <wd@denx.de>2009-06-12 20:45:48 +0200
commitecb1dc892297d5d99876907328fed732feefeab2 (patch)
tree60f14fd9310612bb4ee23d819d9f8fad859beda7 /cpu/blackfin/traps.c
parent36c9169aa6f79ddf604a3bca64e145654f94888b (diff)
downloadu-boot-imx-ecb1dc892297d5d99876907328fed732feefeab2.zip
u-boot-imx-ecb1dc892297d5d99876907328fed732feefeab2.tar.gz
u-boot-imx-ecb1dc892297d5d99876907328fed732feefeab2.tar.bz2
Add support for Linux-like kallsysms
The kernel stores address<->symbol names in it so things can be decoded at runtime. Do it in U-Boot, and we get nice symbol decoding when crashing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'cpu/blackfin/traps.c')
-rw-r--r--cpu/blackfin/traps.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/cpu/blackfin/traps.c b/cpu/blackfin/traps.c
index 2121b0e..7e7c74c 100644
--- a/cpu/blackfin/traps.c
+++ b/cpu/blackfin/traps.c
@@ -171,38 +171,13 @@ void trap_c(struct pt_regs *regs)
# define ENABLE_DUMP 0
#endif
-#ifdef CONFIG_DEBUG_DUMP_SYMS
-# define ENABLE_DUMP_SYMS 1
-#else
-# define ENABLE_DUMP_SYMS 0
-#endif
-
-static const char *symbol_lookup(unsigned long addr, unsigned long *caddr)
+#ifndef CONFIG_KALLSYMS
+const char *symbol_lookup(unsigned long addr, unsigned long *caddr)
{
- if (!ENABLE_DUMP_SYMS)
- return NULL;
-
- extern const char system_map[] __attribute__((__weak__));
- const char *sym, *csym;
- char *esym;
- unsigned long sym_addr;
-
- sym = system_map;
- csym = NULL;
- *caddr = 0;
-
- while (*sym) {
- sym_addr = simple_strtoul(sym, &esym, 16);
- sym = esym;
- if (sym_addr > addr)
- break;
- *caddr = sym_addr;
- csym = sym;
- sym += strlen(sym) + 1;
- }
-
- return csym;
+ *caddr = addr;
+ return "N/A";
}
+#endif
static void decode_address(char *buf, unsigned long address)
{