extable.c 488 B

1234567891011121314151617181920212223
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * linux/arch/arm/mm/extable.c
  4. */
  5. #include <linux/extable.h>
  6. #include <linux/uaccess.h>
  7. int fixup_exception(struct pt_regs *regs)
  8. {
  9. const struct exception_table_entry *fixup;
  10. fixup = search_exception_tables(instruction_pointer(regs));
  11. if (fixup) {
  12. regs->ARM_pc = fixup->fixup;
  13. #ifdef CONFIG_THUMB2_KERNEL
  14. /* Clear the IT state to avoid nasty surprises in the fixup */
  15. regs->ARM_cpsr &= ~PSR_IT_MASK;
  16. #endif
  17. }
  18. return fixup != NULL;
  19. }