]>
git.ipfire.org Git - thirdparty/linux.git/blob - arch/powerpc/include/asm/module.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _ASM_POWERPC_MODULE_H
3 #define _ASM_POWERPC_MODULE_H
6 #include <linux/list.h>
8 #include <asm-generic/module.h>
12 * Thanks to Paul M for explaining this.
14 * PPC can only do rel jumps += 32MB, and often the kernel and other
15 * modules are further away than this. So, we jump to a table of
16 * trampolines attached to the module (the Procedure Linkage Table)
17 * whenever that happens.
20 struct ppc_plt_entry
{
21 /* 16 byte jump instruction sequence (4 instructions) */
24 #endif /* __powerpc64__ */
27 struct mod_arch_specific
{
29 unsigned int stubs_section
; /* Index of stubs section in module */
30 unsigned int toc_section
; /* What section is the TOC? */
31 bool toc_fixed
; /* Have we fixed up .TOC.? */
33 /* For module function descriptor dereference */
34 unsigned long start_opd
;
35 unsigned long end_opd
;
37 /* Indices of PLT sections within module. */
38 unsigned int core_plt_section
;
39 unsigned int init_plt_section
;
40 #endif /* powerpc64 */
42 #ifdef CONFIG_DYNAMIC_FTRACE
44 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
45 unsigned long tramp_regs
;
49 /* List of BUG addresses, source line numbers and filenames */
50 struct list_head bug_list
;
51 struct bug_entry
*bug_table
;
52 unsigned int num_bugs
;
57 * Make empty section for module_frob_arch_sections to expand.
62 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
66 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
67 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
71 #ifdef CONFIG_DYNAMIC_FTRACE
73 asm(".section .ftrace.tramp,\"ax\",@nobits; .align 3; .previous");
77 int module_trampoline_target(struct module
*mod
, unsigned long trampoline
,
78 unsigned long *target
);
80 #ifdef CONFIG_DYNAMIC_FTRACE
81 int module_finalize_ftrace(struct module
*mod
, const Elf_Shdr
*sechdrs
);
83 static inline int module_finalize_ftrace(struct module
*mod
, const Elf_Shdr
*sechdrs
)
89 #endif /* __KERNEL__ */
90 #endif /* _ASM_POWERPC_MODULE_H */