1 #ifndef _ASM_POWERPC_MODULE_H
2 #define _ASM_POWERPC_MODULE_H
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.
12 #include <linux/list.h>
14 #include <asm-generic/module.h>
17 #ifdef CC_USING_MPROFILE_KERNEL
18 #define MODULE_ARCH_VERMAGIC "mprofile-kernel"
23 * Thanks to Paul M for explaining this.
25 * PPC can only do rel jumps += 32MB, and often the kernel and other
26 * modules are further away than this. So, we jump to a table of
27 * trampolines attached to the module (the Procedure Linkage Table)
28 * whenever that happens.
31 struct ppc_plt_entry {
32 /* 16 byte jump instruction sequence (4 instructions) */
35 #endif /* __powerpc64__ */
38 struct mod_arch_specific {
40 unsigned int stubs_section; /* Index of stubs section in module */
41 unsigned int toc_section; /* What section is the TOC? */
42 bool toc_fixed; /* Have we fixed up .TOC.? */
43 #ifdef CONFIG_DYNAMIC_FTRACE
49 /* Indices of PLT sections within module. */
50 unsigned int core_plt_section;
51 unsigned int init_plt_section;
52 #ifdef CONFIG_DYNAMIC_FTRACE
55 #endif /* powerpc64 */
57 /* List of BUG addresses, source line numbers and filenames */
58 struct list_head bug_list;
59 struct bug_entry *bug_table;
60 unsigned int num_bugs;
65 * Make empty section for module_frob_arch_sections to expand.
70 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
74 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
75 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
79 #ifdef CONFIG_DYNAMIC_FTRACE
81 asm(".section .ftrace.tramp,\"ax\",@nobits; .align 3; .previous");
85 int module_trampoline_target(struct module *mod, unsigned long trampoline,
86 unsigned long *target);
88 #ifdef CONFIG_DYNAMIC_FTRACE
89 int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs);
91 static inline int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs)
97 #endif /* __KERNEL__ */
98 #endif /* _ASM_POWERPC_MODULE_H */