]>
Commit | Line | Data |
---|---|---|
a37c8875 | 1 | #ifndef _ASM_POWERPC_MODULE_H |
2 | #define _ASM_POWERPC_MODULE_H | |
88ced031 | 3 | #ifdef __KERNEL__ |
6b9269ab JL |
4 | |
5 | /* | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License | |
8 | * as published by the Free Software Foundation; either version | |
9 | * 2 of the License, or (at your option) any later version. | |
10 | */ | |
11 | ||
12 | #include <linux/list.h> | |
13 | #include <asm/bug.h> | |
786d35d4 | 14 | #include <asm-generic/module.h> |
6b9269ab JL |
15 | |
16 | ||
17 | #ifndef __powerpc64__ | |
18 | /* | |
19 | * Thanks to Paul M for explaining this. | |
20 | * | |
21 | * PPC can only do rel jumps += 32MB, and often the kernel and other | |
22 | * modules are furthur away than this. So, we jump to a table of | |
23 | * trampolines attached to the module (the Procedure Linkage Table) | |
24 | * whenever that happens. | |
25 | */ | |
26 | ||
27 | struct ppc_plt_entry { | |
28 | /* 16 byte jump instruction sequence (4 instructions) */ | |
29 | unsigned int jump[4]; | |
30 | }; | |
31 | #endif /* __powerpc64__ */ | |
32 | ||
33 | ||
34 | struct mod_arch_specific { | |
35 | #ifdef __powerpc64__ | |
36 | unsigned int stubs_section; /* Index of stubs section in module */ | |
37 | unsigned int toc_section; /* What section is the TOC? */ | |
4edebbea | 38 | bool toc_fixed; /* Have we fixed up .TOC.? */ |
f48cb8b4 SR |
39 | #ifdef CONFIG_DYNAMIC_FTRACE |
40 | unsigned long toc; | |
41 | unsigned long tramp; | |
42 | #endif | |
43 | ||
7cc45e64 | 44 | #else /* powerpc64 */ |
6b9269ab JL |
45 | /* Indices of PLT sections within module. */ |
46 | unsigned int core_plt_section; | |
47 | unsigned int init_plt_section; | |
7cc45e64 SR |
48 | #ifdef CONFIG_DYNAMIC_FTRACE |
49 | unsigned long tramp; | |
6b9269ab | 50 | #endif |
7cc45e64 | 51 | #endif /* powerpc64 */ |
6b9269ab JL |
52 | |
53 | /* List of BUG addresses, source line numbers and filenames */ | |
54 | struct list_head bug_list; | |
55 | struct bug_entry *bug_table; | |
56 | unsigned int num_bugs; | |
57 | }; | |
58 | ||
6b9269ab JL |
59 | /* |
60 | * Select ELF headers. | |
61 | * Make empty section for module_frob_arch_sections to expand. | |
62 | */ | |
63 | ||
64 | #ifdef __powerpc64__ | |
6b9269ab JL |
65 | # ifdef MODULE |
66 | asm(".section .stubs,\"ax\",@nobits; .align 3; .previous"); | |
67 | # endif | |
68 | #else | |
6b9269ab JL |
69 | # ifdef MODULE |
70 | asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); | |
71 | asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); | |
72 | # endif /* MODULE */ | |
73 | #endif | |
74 | ||
f48cb8b4 SR |
75 | #ifdef CONFIG_DYNAMIC_FTRACE |
76 | # ifdef MODULE | |
77 | asm(".section .ftrace.tramp,\"ax\",@nobits; .align 3; .previous"); | |
78 | # endif /* MODULE */ | |
79 | #endif | |
80 | ||
83775b85 | 81 | bool is_module_trampoline(u32 *insns); |
6b9269ab JL |
82 | |
83 | struct exception_table_entry; | |
84 | void sort_ex_table(struct exception_table_entry *start, | |
85 | struct exception_table_entry *finish); | |
86 | ||
0e0ed640 | 87 | #if defined(CONFIG_MODVERSIONS) && defined(CONFIG_PPC64) |
d4703aef | 88 | #define ARCH_RELOCATES_KCRCTAB |
0e0ed640 | 89 | #define reloc_start PHYSICAL_START |
d4703aef | 90 | #endif |
88ced031 | 91 | #endif /* __KERNEL__ */ |
a37c8875 | 92 | #endif /* _ASM_POWERPC_MODULE_H */ |