extable.c 463 B

123456789101112131415161718192021222324
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  4. *
  5. * Borrowed heavily from MIPS
  6. */
  7. #include <linux/export.h>
  8. #include <linux/extable.h>
  9. #include <linux/uaccess.h>
  10. int fixup_exception(struct pt_regs *regs)
  11. {
  12. const struct exception_table_entry *fixup;
  13. fixup = search_exception_tables(instruction_pointer(regs));
  14. if (fixup) {
  15. regs->ret = fixup->fixup;
  16. return 1;
  17. }
  18. return 0;
  19. }