aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kallsyms.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 20:50:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 20:50:37 -0400
commita442ac512f36981182e66a427ad05f449ff6593b (patch)
tree8a99f2f4cb7f66e816163068c0c2c709c1852ac6 /include/linux/kallsyms.h
parent7371fd11a6e2aed99895db4f100940fa5022f7fe (diff)
Clean up 'print_fn_descriptor_symbol()' types
Everybody wants to pass it a function pointer, and in fact, that is what you _must_ pass it for it to make sense (since it knows that ia64 and ppc64 use descriptors for function pointers and fetches the actual address from there). So don't make the argument be a 'unsigned long' and force everybody to add a cast. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kallsyms.h')
-rw-r--r--include/linux/kallsyms.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 82de2fb62cb7..00c1801099fa 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -83,16 +83,6 @@ __attribute__((format(printf,1,2)));
83static inline void __check_printsym_format(const char *fmt, ...) 83static inline void __check_printsym_format(const char *fmt, ...)
84{ 84{
85} 85}
86/* ia64 and ppc64 use function descriptors, which contain the real address */
87#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
88#define print_fn_descriptor_symbol(fmt, addr) \
89do { \
90 unsigned long *__faddr = (unsigned long*) addr; \
91 print_symbol(fmt, __faddr[0]); \
92} while (0)
93#else
94#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
95#endif
96 86
97static inline void print_symbol(const char *fmt, unsigned long addr) 87static inline void print_symbol(const char *fmt, unsigned long addr)
98{ 88{
@@ -101,6 +91,20 @@ static inline void print_symbol(const char *fmt, unsigned long addr)
101 __builtin_extract_return_addr((void *)addr)); 91 __builtin_extract_return_addr((void *)addr));
102} 92}
103 93
94/*
95 * Pretty-print a function pointer.
96 *
97 * ia64 and ppc64 function pointers are really function descriptors,
98 * which contain a pointer the real address.
99 */
100static inline void print_fn_descriptor_symbol(const char *fmt, void *addr)
101{
102#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
103 addr = *(void **)addr;
104#endif
105 print_symbol(fmt, (unsigned long)addr);
106}
107
104#ifndef CONFIG_64BIT 108#ifndef CONFIG_64BIT
105#define print_ip_sym(ip) \ 109#define print_ip_sym(ip) \
106do { \ 110do { \