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#ifndef __powerpc64__
18
19
20
21
22
23
24
25
26
27struct ppc_plt_entry {
28
29 unsigned int jump[4];
30};
31#endif
32
33
34struct mod_arch_specific {
35#ifdef __powerpc64__
36 unsigned int stubs_section;
37 unsigned int toc_section;
38 bool toc_fixed;
39#ifdef CONFIG_DYNAMIC_FTRACE
40 unsigned long toc;
41 unsigned long tramp;
42#endif
43
44#else
45
46 unsigned int core_plt_section;
47 unsigned int init_plt_section;
48#ifdef CONFIG_DYNAMIC_FTRACE
49 unsigned long tramp;
50#endif
51#endif
52
53
54 struct list_head bug_list;
55 struct bug_entry *bug_table;
56 unsigned int num_bugs;
57};
58
59
60
61
62
63
64#ifdef __powerpc64__
65# ifdef MODULE
66 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
67# endif
68#else
69# ifdef MODULE
70 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
71 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
72# endif
73#endif
74
75#ifdef CONFIG_DYNAMIC_FTRACE
76# ifdef MODULE
77 asm(".section .ftrace.tramp,\"ax\",@nobits; .align 3; .previous");
78# endif
79#endif
80
81bool is_module_trampoline(u32 *insns);
82int module_trampoline_target(struct module *mod, u32 *trampoline,
83 unsigned long *target);
84
85struct exception_table_entry;
86void sort_ex_table(struct exception_table_entry *start,
87 struct exception_table_entry *finish);
88
89#if defined(CONFIG_MODVERSIONS) && defined(CONFIG_PPC64)
90#define ARCH_RELOCATES_KCRCTAB
91#define reloc_start PHYSICAL_START
92#endif
93#endif
94#endif
95