Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / arch / powerpc / include / asm / sections.h
1 #ifndef _ASM_POWERPC_SECTIONS_H
2 #define _ASM_POWERPC_SECTIONS_H
3 #ifdef __KERNEL__
4
5 #include <linux/elf.h>
6 #include <linux/uaccess.h>
7 #include <asm-generic/sections.h>
8
9 #ifdef __powerpc64__
10
11 extern char _end[];
12
13 static inline int in_kernel_text(unsigned long addr)
14 {
15         if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end)
16                 return 1;
17
18         return 0;
19 }
20
21 #undef dereference_function_descriptor
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 }
31
32 #endif
33
34 #endif /* __KERNEL__ */
35 #endif  /* _ASM_POWERPC_SECTIONS_H */