extable.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_EXTABLE_H
  3. #define _LINUX_EXTABLE_H
  4. #include <linux/stddef.h> /* for NULL */
  5. #include <linux/types.h>
  6. struct module;
  7. struct exception_table_entry;
  8. const struct exception_table_entry *
  9. search_extable(const struct exception_table_entry *base,
  10. const size_t num,
  11. unsigned long value);
  12. void sort_extable(struct exception_table_entry *start,
  13. struct exception_table_entry *finish);
  14. void sort_main_extable(void);
  15. void trim_init_extable(struct module *m);
  16. /* Given an address, look for it in the exception tables */
  17. const struct exception_table_entry *search_exception_tables(unsigned long add);
  18. const struct exception_table_entry *
  19. search_kernel_exception_table(unsigned long addr);
  20. #ifdef CONFIG_MODULES
  21. /* For extable.c to search modules' exception tables. */
  22. const struct exception_table_entry *search_module_extables(unsigned long addr);
  23. #else
  24. static inline const struct exception_table_entry *
  25. search_module_extables(unsigned long addr)
  26. {
  27. return NULL;
  28. }
  29. #endif /*CONFIG_MODULES*/
  30. #ifdef CONFIG_BPF_JIT
  31. const struct exception_table_entry *search_bpf_extables(unsigned long addr);
  32. #else
  33. static inline const struct exception_table_entry *
  34. search_bpf_extables(unsigned long addr)
  35. {
  36. return NULL;
  37. }
  38. #endif
  39. #endif /* _LINUX_EXTABLE_H */