module.h 2.2 KB

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