diff options
Diffstat (limited to 'arch/powerpc/include/asm/sections.h')
| -rw-r--r-- | arch/powerpc/include/asm/sections.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 7710e9e6660f..07956f3e7844 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | #define _ASM_POWERPC_SECTIONS_H | 2 | #define _ASM_POWERPC_SECTIONS_H |
| 3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
| 4 | 4 | ||
| 5 | #include <linux/elf.h> | ||
| 6 | #include <linux/uaccess.h> | ||
| 5 | #include <asm-generic/sections.h> | 7 | #include <asm-generic/sections.h> |
| 6 | 8 | ||
| 7 | #ifdef __powerpc64__ | 9 | #ifdef __powerpc64__ |
| @@ -17,7 +19,15 @@ static inline int in_kernel_text(unsigned long addr) | |||
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | #undef dereference_function_descriptor | 21 | #undef dereference_function_descriptor |
| 20 | void *dereference_function_descriptor(void *); | 22 | static inline void *dereference_function_descriptor(void *ptr) |
| 23 | { | ||
| 24 | struct ppc64_opd_entry *desc = ptr; | ||
| 25 | void *p; | ||
| 26 | |||
| 27 | if (!probe_kernel_address(&desc->funcaddr, p)) | ||
| 28 | ptr = p; | ||
| 29 | return ptr; | ||
| 30 | } | ||
| 21 | 31 | ||
| 22 | #endif | 32 | #endif |
| 23 | 33 | ||
