lkml.org 
[lkml]   [2004]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[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 redirection is
required.

Tested on ppc, ppc64 and ia64.

Signed-off-by: Olaf Hering <olh@suse.de>

diff -purNx tags linux-2.6.9/include/linux/kallsyms.h linux-2.6.10-rc1-bk14.initcall_debug/include/linux/kallsyms.h
--- linux-2.6.9/include/linux/kallsyms.h 2004-10-18 23:53:06.000000000 +0200
+++ linux-2.6.10-rc1-bk14.initcall_debug/include/linux/kallsyms.h 2004-11-05 10:27:48.722687802 +0100
@@ -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 { \
diff -purNx tags linux-2.6.9/init/main.c linux-2.6.10-rc1-bk14.initcall_debug/init/main.c
--- linux-2.6.9/init/main.c 2004-11-04 21:01:04.000000000 +0100
+++ linux-2.6.10-rc1-bk14.initcall_debug/init/main.c 2004-11-05 10:19:32.254301065 +0100
@@ -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");
}

--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.033 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site