]>
git.ipfire.org Git - people/ms/u-boot.git/blob - common/kallsyms.c
2 * Helper functions for working with the builtin symbol table
4 * Copyright (c) 2008-2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
10 /* We need the weak marking as this symbol is provided specially */
11 extern const char system_map
[] __attribute__((weak
));
13 /* Given an address, return a pointer to the symbol name and store
14 * the base address in caddr. So if the symbol map had an entry:
15 * 03fb9b7c_spi_cs_deactivate
16 * Then the following call:
18 * const char *sym = symbol_lookup(0x03fb9b80, &base);
19 * Would end up setting the variables like so:
21 * sym = "_spi_cs_deactivate";
23 const char *symbol_lookup(unsigned long addr
, unsigned long *caddr
)
25 const char *sym
, *csym
;
27 unsigned long sym_addr
;
34 sym_addr
= simple_strtoul(sym
, &esym
, 16);
40 sym
+= strlen(sym
) + 1;