~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/module.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 #ifndef _ASM_POWERPC_MODULE_H
  3 #define _ASM_POWERPC_MODULE_H
  4 #ifdef __KERNEL__
  5 
  6 #include <linux/list.h>
  7 #include <asm/bug.h>
  8 #include <asm-generic/module.h>
  9 
 10 #ifndef __powerpc64__
 11 /*
 12  * Thanks to Paul M for explaining this.
 13  *
 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.
 18  */
 19 
 20 struct ppc_plt_entry {
 21         /* 16 byte jump instruction sequence (4 instructions) */
 22         unsigned int jump[4];
 23 };
 24 #endif  /* __powerpc64__ */
 25 
 26 
 27 struct mod_arch_specific {
 28 #ifdef __powerpc64__
 29         unsigned int stubs_section;     /* Index of stubs section in module */
 30 #ifdef CONFIG_PPC_KERNEL_PCREL
 31         unsigned int got_section;       /* What section is the GOT? */
 32         unsigned int pcpu_section;      /* .data..percpu section */
 33 #else
 34         unsigned int toc_section;       /* What section is the TOC? */
 35         bool toc_fixed;                 /* Have we fixed up .TOC.? */
 36 #endif
 37 
 38         /* For module function descriptor dereference */
 39         unsigned long start_opd;
 40         unsigned long end_opd;
 41 #else /* powerpc64 */
 42         /* Indices of PLT sections within module. */
 43         unsigned int core_plt_section;
 44         unsigned int init_plt_section;
 45 #endif /* powerpc64 */
 46 
 47 #ifdef CONFIG_DYNAMIC_FTRACE
 48         unsigned long tramp;
 49         unsigned long tramp_regs;
 50 #endif
 51 };
 52 
 53 /*
 54  * Select ELF headers.
 55  * Make empty sections for module_frob_arch_sections to expand.
 56  */
 57 
 58 #ifdef __powerpc64__
 59 #    ifdef MODULE
 60         asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
 61 #        ifdef CONFIG_PPC_KERNEL_PCREL
 62             asm(".section .mygot,\"a\",@nobits; .align 3; .previous");
 63 #        endif
 64 #    endif
 65 #else
 66 #    ifdef MODULE
 67         asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
 68         asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
 69 #    endif      /* MODULE */
 70 #endif
 71 
 72 #ifdef CONFIG_DYNAMIC_FTRACE
 73 int module_trampoline_target(struct module *mod, unsigned long trampoline,
 74                              unsigned long *target);
 75 int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs);
 76 #else
 77 static inline int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs)
 78 {
 79         return 0;
 80 }
 81 #endif
 82 
 83 #endif /* __KERNEL__ */
 84 #endif  /* _ASM_POWERPC_MODULE_H */
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php