module.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _ASM_ARM_MODULE_H
  2. #define _ASM_ARM_MODULE_H
  3. #include <asm-generic/module.h>
  4. struct unwind_table;
  5. #ifdef CONFIG_ARM_UNWIND
  6. enum {
  7. ARM_SEC_INIT,
  8. ARM_SEC_DEVINIT,
  9. ARM_SEC_CORE,
  10. ARM_SEC_EXIT,
  11. ARM_SEC_DEVEXIT,
  12. ARM_SEC_HOT,
  13. ARM_SEC_UNLIKELY,
  14. ARM_SEC_MAX,
  15. };
  16. #endif
  17. struct mod_plt_sec {
  18. struct elf32_shdr *plt;
  19. int plt_count;
  20. };
  21. struct mod_arch_specific {
  22. #ifdef CONFIG_ARM_UNWIND
  23. struct unwind_table *unwind[ARM_SEC_MAX];
  24. #endif
  25. #ifdef CONFIG_ARM_MODULE_PLTS
  26. struct mod_plt_sec core;
  27. struct mod_plt_sec init;
  28. #endif
  29. };
  30. u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
  31. /*
  32. * Add the ARM architecture version to the version magic string
  33. */
  34. #define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
  35. /* Add __virt_to_phys patching state as well */
  36. #ifdef CONFIG_ARM_PATCH_PHYS_VIRT
  37. #define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
  38. #else
  39. #define MODULE_ARCH_VERMAGIC_P2V ""
  40. #endif
  41. /* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
  42. #ifdef CONFIG_THUMB2_KERNEL
  43. #define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
  44. #else
  45. #define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
  46. #endif
  47. #define MODULE_ARCH_VERMAGIC \
  48. MODULE_ARCH_VERMAGIC_ARMVSN \
  49. MODULE_ARCH_VERMAGIC_ARMTHUMB \
  50. MODULE_ARCH_VERMAGIC_P2V
  51. #endif /* _ASM_ARM_MODULE_H */