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/parisc/kernel | |
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/parisc/kernel')
-rw-r--r-- | arch/parisc/kernel/module.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index fdacdd4341c9..44138c3e6ea7 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -47,7 +47,9 @@ | |||
47 | #include <linux/string.h> | 47 | #include <linux/string.h> |
48 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
49 | #include <linux/bug.h> | 49 | #include <linux/bug.h> |
50 | #include <linux/uaccess.h> | ||
50 | 51 | ||
52 | #include <asm/sections.h> | ||
51 | #include <asm/unwind.h> | 53 | #include <asm/unwind.h> |
52 | 54 | ||
53 | #if 0 | 55 | #if 0 |
@@ -860,3 +862,15 @@ void module_arch_cleanup(struct module *mod) | |||
860 | deregister_unwind_table(mod); | 862 | deregister_unwind_table(mod); |
861 | module_bug_cleanup(mod); | 863 | module_bug_cleanup(mod); |
862 | } | 864 | } |
865 | |||
866 | #ifdef CONFIG_64BIT | ||
867 | void *dereference_function_descriptor(void *ptr) | ||
868 | { | ||
869 | Elf64_Fdesc *desc = ptr; | ||
870 | void *p; | ||
871 | |||
872 | if (!probe_kernel_address(&desc->addr, p)) | ||
873 | ptr = p; | ||
874 | return ptr; | ||
875 | } | ||
876 | #endif | ||