PageRenderTime 9ms CodeModel.GetById 5ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/powerpc/include/asm/sections.h

https://github.com/aicjofs/android_kernel_lge_v500_20d
C Header | 41 lines | 31 code | 10 blank | 0 comment | 3 complexity | 25173050d3821daca3ff1c9be3da8798 MD5 | raw file
 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
11extern char __end_interrupts[];
12
13static 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
21static inline int overlaps_kernel_text(unsigned long start, unsigned long end)
22{
23	return start < (unsigned long)__init_end &&
24		(unsigned long)_stext < end;
25}
26
27#undef dereference_function_descriptor
28static inline void *dereference_function_descriptor(void *ptr)
29{
30	struct ppc64_opd_entry *desc = ptr;
31	void *p;
32
33	if (!probe_kernel_address(&desc->funcaddr, p))
34		ptr = p;
35	return ptr;
36}
37
38#endif
39
40#endif /* __KERNEL__ */
41#endif	/* _ASM_POWERPC_SECTIONS_H */