extable.h 776 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __VDSO_EXTABLE_H
  3. #define __VDSO_EXTABLE_H
  4. /*
  5. * Inject exception fixup for vDSO code. Unlike normal exception fixup,
  6. * vDSO uses a dedicated handler the addresses are relative to the overall
  7. * exception table, not each individual entry.
  8. */
  9. #ifdef __ASSEMBLY__
  10. #define _ASM_VDSO_EXTABLE_HANDLE(from, to) \
  11. ASM_VDSO_EXTABLE_HANDLE from to
  12. .macro ASM_VDSO_EXTABLE_HANDLE from:req to:req
  13. .pushsection __ex_table, "a"
  14. .long (\from) - __ex_table
  15. .long (\to) - __ex_table
  16. .popsection
  17. .endm
  18. #else
  19. #define _ASM_VDSO_EXTABLE_HANDLE(from, to) \
  20. ".pushsection __ex_table, \"a\"\n" \
  21. ".long (" #from ") - __ex_table\n" \
  22. ".long (" #to ") - __ex_table\n" \
  23. ".popsection\n"
  24. #endif
  25. #endif /* __VDSO_EXTABLE_H */