1
2#ifndef _ASM_POWERPC_MODULE_H
3#define _ASM_POWERPC_MODULE_H
4#ifdef __KERNEL__
5
6#include <linux/list.h>
7#include <asm/bug.h>
8#include <asm-generic/module.h>
9
10#ifndef __powerpc64__
11
12
13
14
15
16
17
18
19
20struct ppc_plt_entry {
21
22 unsigned int jump[4];
23};
24#endif
25
26
27struct mod_arch_specific {
28#ifdef __powerpc64__
29 unsigned int stubs_section;
30 unsigned int toc_section;
31 bool toc_fixed;
32
33
34 unsigned long start_opd;
35 unsigned long end_opd;
36#else
37
38 unsigned int core_plt_section;
39 unsigned int init_plt_section;
40#endif
41
42#ifdef CONFIG_DYNAMIC_FTRACE
43 unsigned long tramp;
44#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
45 unsigned long tramp_regs;
46#endif
47#endif
48
49
50 struct list_head bug_list;
51 struct bug_entry *bug_table;
52 unsigned int num_bugs;
53};
54
55
56
57
58
59
60#ifdef __powerpc64__
61# ifdef MODULE
62 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
63# endif
64#else
65# ifdef MODULE
66 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
67 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
68# endif
69#endif
70
71#ifdef CONFIG_DYNAMIC_FTRACE
72# ifdef MODULE
73 asm(".section .ftrace.tramp,\"ax\",@nobits; .align 3; .previous");
74# endif
75
76int module_trampoline_target(struct module *mod, unsigned long trampoline,
77 unsigned long *target);
78int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs);
79#else
80static inline int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs)
81{
82 return 0;
83}
84#endif
85
86#endif
87#endif
88