diff options
Diffstat (limited to 'include/linux/kallsyms.h')
-rw-r--r-- | include/linux/kallsyms.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 1cebcbc28b47..3e3b92dabe3b 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | #define KSYM_NAME_LEN 127 | 9 | #define KSYM_NAME_LEN 127 |
10 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | ||
11 | 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) | ||
10 | 12 | ||
11 | #ifdef CONFIG_KALLSYMS | 13 | #ifdef CONFIG_KALLSYMS |
12 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 14 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
@@ -22,7 +24,10 @@ const char *kallsyms_lookup(unsigned long addr, | |||
22 | unsigned long *offset, | 24 | unsigned long *offset, |
23 | char **modname, char *namebuf); | 25 | char **modname, char *namebuf); |
24 | 26 | ||
25 | /* Replace "%s" in format with address, if found */ | 27 | /* Look up a kernel symbol and return it in a text buffer. */ |
28 | extern int sprint_symbol(char *buffer, unsigned long address); | ||
29 | |||
30 | /* Look up a kernel symbol and print it to the kernel messages. */ | ||
26 | extern void __print_symbol(const char *fmt, unsigned long address); | 31 | extern void __print_symbol(const char *fmt, unsigned long address); |
27 | 32 | ||
28 | #else /* !CONFIG_KALLSYMS */ | 33 | #else /* !CONFIG_KALLSYMS */ |
@@ -47,6 +52,12 @@ static inline const char *kallsyms_lookup(unsigned long addr, | |||
47 | return NULL; | 52 | return NULL; |
48 | } | 53 | } |
49 | 54 | ||
55 | static inline int sprint_symbol(char *buffer, unsigned long addr) | ||
56 | { | ||
57 | *buffer = '\0'; | ||
58 | return 0; | ||
59 | } | ||
60 | |||
50 | /* Stupid that this does nothing, but I didn't create this mess. */ | 61 | /* Stupid that this does nothing, but I didn't create this mess. */ |
51 | #define __print_symbol(fmt, addr) | 62 | #define __print_symbol(fmt, addr) |
52 | #endif /*CONFIG_KALLSYMS*/ | 63 | #endif /*CONFIG_KALLSYMS*/ |