Commit 7602d249 authored by Olaf Hering's avatar Olaf Hering Committed by Linus Torvalds

[PATCH] fix initcall_debug on ppc64/ia64

ia64 and ppc64 have function descriptors.  Booting with initcall_debug will
print the descriptor address, not the address and name of the actual
function.  Another indirection is required.

Tested on ppc, ppc64 and ia64.
Signed-off-by: default avatarOlaf Hering <olh@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 38b7c3b2
......@@ -47,6 +47,16 @@ __attribute__((format(printf,1,2)));
static inline void __check_printsym_format(const char *fmt, ...)
{
}
/* ia64 and ppc64 use function descriptors, which contain the real address */
#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
#define print_fn_descriptor_symbol(fmt, addr) \
do { \
unsigned long *__faddr = (unsigned long*) addr; \
print_symbol(fmt, __faddr[0]); \
} while (0)
#else
#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
#endif
#define print_symbol(fmt, addr) \
do { \
......
......@@ -604,7 +604,7 @@ static void __init do_initcalls(void)
if (initcall_debug) {
printk(KERN_DEBUG "Calling initcall 0x%p", *call);
print_symbol(": %s()", (unsigned long) *call);
print_fn_descriptor_symbol(": %s()", (unsigned long) *call);
printk("\n");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment