diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-09-03 21:43:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-09 14:51:15 -0400 |
commit | deac93df26b20cf8438339b5935b5f5643bc30c9 (patch) | |
tree | 8e67edd505e4a8bde380c724b67ce9ca98b8ee91 /arch/ia64 | |
parent | 7ae115b4f50d3c5824f1a15e572b5de9d1b06d35 (diff) |
lib: Correct printk %pF to work on all architectures
It was introduced by "vsprintf: add support for '%pS' and '%pF' pointer
formats" in commit 0fe1ef24f7bd0020f29ffe287dfdb9ead33ca0b2. However,
the current way its coded doesn't work on parisc64. For two reasons: 1)
parisc isn't in the #ifdef and 2) parisc has a different format for
function descriptors
Make dereference_function_descriptor() more accommodating by allowing
architecture overrides. I put the three overrides (for parisc64, ppc64
and ia64) in arch/kernel/module.c because that's where the kernel
internal linker which knows how to deal with function descriptors sits.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tony Luck <tony.luck@intel.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/sections.h | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/module.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h index 7286e4a9fe84..a7acad2bc2f0 100644 --- a/arch/ia64/include/asm/sections.h +++ b/arch/ia64/include/asm/sections.h | |||
@@ -21,5 +21,8 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b | |||
21 | extern char __start_unwind[], __end_unwind[]; | 21 | extern char __start_unwind[], __end_unwind[]; |
22 | extern char __start_ivt_text[], __end_ivt_text[]; | 22 | extern char __start_ivt_text[], __end_ivt_text[]; |
23 | 23 | ||
24 | #undef dereference_function_descriptor | ||
25 | void *dereference_function_descriptor(void *); | ||
26 | |||
24 | #endif /* _ASM_IA64_SECTIONS_H */ | 27 | #endif /* _ASM_IA64_SECTIONS_H */ |
25 | 28 | ||
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 29aad349e0c4..545626f66a4c 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -31,9 +31,11 @@ | |||
31 | #include <linux/elf.h> | 31 | #include <linux/elf.h> |
32 | #include <linux/moduleloader.h> | 32 | #include <linux/moduleloader.h> |
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/uaccess.h> | ||
34 | #include <linux/vmalloc.h> | 35 | #include <linux/vmalloc.h> |
35 | 36 | ||
36 | #include <asm/patch.h> | 37 | #include <asm/patch.h> |
38 | #include <asm/sections.h> | ||
37 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
38 | 40 | ||
39 | #define ARCH_MODULE_DEBUG 0 | 41 | #define ARCH_MODULE_DEBUG 0 |
@@ -941,3 +943,13 @@ module_arch_cleanup (struct module *mod) | |||
941 | if (mod->arch.core_unw_table) | 943 | if (mod->arch.core_unw_table) |
942 | unw_remove_unwind_table(mod->arch.core_unw_table); | 944 | unw_remove_unwind_table(mod->arch.core_unw_table); |
943 | } | 945 | } |
946 | |||
947 | void *dereference_function_descriptor(void *ptr) | ||
948 | { | ||
949 | struct fdesc *desc = ptr; | ||
950 | void *p; | ||
951 | |||
952 | if (!probe_kernel_address(&desc->ip, p)) | ||
953 | ptr = p; | ||
954 | return ptr; | ||
955 | } | ||