module.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _ASM_MODULE_H
  2. #define _ASM_MODULE_H
  3. #include <linux/config.h>
  4. #include <linux/list.h>
  5. #include <asm/uaccess.h>
  6. struct mod_arch_specific {
  7. /* Data Bus Error exception tables */
  8. struct list_head dbe_list;
  9. const struct exception_table_entry *dbe_start;
  10. const struct exception_table_entry *dbe_end;
  11. };
  12. typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
  13. typedef struct {
  14. Elf64_Addr r_offset; /* Address of relocation. */
  15. Elf64_Word r_sym; /* Symbol index. */
  16. Elf64_Byte r_ssym; /* Special symbol. */
  17. Elf64_Byte r_type3; /* Third relocation. */
  18. Elf64_Byte r_type2; /* Second relocation. */
  19. Elf64_Byte r_type; /* First relocation. */
  20. } Elf64_Mips_Rel;
  21. typedef struct {
  22. Elf64_Addr r_offset; /* Address of relocation. */
  23. Elf64_Word r_sym; /* Symbol index. */
  24. Elf64_Byte r_ssym; /* Special symbol. */
  25. Elf64_Byte r_type3; /* Third relocation. */
  26. Elf64_Byte r_type2; /* Second relocation. */
  27. Elf64_Byte r_type; /* First relocation. */
  28. Elf64_Sxword r_addend; /* Addend. */
  29. } Elf64_Mips_Rela;
  30. #ifdef CONFIG_32BIT
  31. #define Elf_Shdr Elf32_Shdr
  32. #define Elf_Sym Elf32_Sym
  33. #define Elf_Ehdr Elf32_Ehdr
  34. #define Elf_Addr Elf32_Addr
  35. #define Elf_Mips_Rel Elf32_Rel
  36. #define Elf_Mips_Rela Elf32_Rela
  37. #define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
  38. #define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
  39. #endif
  40. #ifdef CONFIG_64BIT
  41. #define Elf_Shdr Elf64_Shdr
  42. #define Elf_Sym Elf64_Sym
  43. #define Elf_Ehdr Elf64_Ehdr
  44. #define Elf_Addr Elf64_Addr
  45. #define Elf_Mips_Rel Elf64_Mips_Rel
  46. #define Elf_Mips_Rela Elf64_Mips_Rela
  47. #define ELF_MIPS_R_SYM(rel) (rel.r_sym)
  48. #define ELF_MIPS_R_TYPE(rel) (rel.r_type)
  49. #endif
  50. #ifdef CONFIG_MODULES
  51. /* Given an address, look for it in the exception tables. */
  52. const struct exception_table_entry*search_module_dbetables(unsigned long addr);
  53. #else
  54. /* Given an address, look for it in the exception tables. */
  55. static inline const struct exception_table_entry *
  56. search_module_dbetables(unsigned long addr)
  57. {
  58. return NULL;
  59. }
  60. #endif
  61. #endif /* _ASM_MODULE_H */