module.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_arch_specific {
  18. #ifdef CONFIG_ARM_UNWIND
  19. struct unwind_table *unwind[ARM_SEC_MAX];
  20. #endif
  21. #ifdef CONFIG_ARM_MODULE_PLTS
  22. struct elf32_shdr *plt;
  23. int plt_count;
  24. #endif
  25. };
  26. u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
  27. /*
  28. * Add the ARM architecture version to the version magic string
  29. */
  30. #define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
  31. /* Add __virt_to_phys patching state as well */
  32. #ifdef CONFIG_ARM_PATCH_PHYS_VIRT
  33. #define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
  34. #else
  35. #define MODULE_ARCH_VERMAGIC_P2V ""
  36. #endif
  37. /* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
  38. #ifdef CONFIG_THUMB2_KERNEL
  39. #define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
  40. #else
  41. #define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
  42. #endif
  43. #define MODULE_ARCH_VERMAGIC \
  44. MODULE_ARCH_VERMAGIC_ARMVSN \
  45. MODULE_ARCH_VERMAGIC_ARMTHUMB \
  46. MODULE_ARCH_VERMAGIC_P2V
  47. #endif /* _ASM_ARM_MODULE_H */