From ecb1dc892297d5d99876907328fed732feefeab2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 20 May 2009 04:35:14 -0400 Subject: 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 --- cpu/blackfin/system_map.S | 18 ------------------ cpu/blackfin/traps.c | 35 +++++------------------------------ 2 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 cpu/blackfin/system_map.S (limited to 'cpu/blackfin') diff --git a/cpu/blackfin/system_map.S b/cpu/blackfin/system_map.S deleted file mode 100644 index 286d7f34a..000000000 --- a/cpu/blackfin/system_map.S +++ /dev/null @@ -1,18 +0,0 @@ -/* - * system_map.S - optional symbol lookup for debugging - * - * Copyright (c) 2007 Analog Devices Inc. - * Licensed under the GPL-2 or later. - */ - -#include - -#ifdef CONFIG_DEBUG_DUMP_SYMS -.data -.global _system_map -.type _system_map,@object -_system_map: -#include SYM_FILE -.asciz "" -.size _system_map,.-_system_map -#endif diff --git a/cpu/blackfin/traps.c b/cpu/blackfin/traps.c index 2121b0e4c..7e7c74ce4 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) { -- cgit v1.2.3