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