module.h 1.3 KB

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