extable.c 437 B

12345678910111213141516171819202122
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  4. */
  5. #include <linux/extable.h>
  6. #include <linux/spinlock.h>
  7. #include <asm/branch.h>
  8. #include <linux/uaccess.h>
  9. int fixup_exception(struct pt_regs *regs)
  10. {
  11. const struct exception_table_entry *fixup;
  12. fixup = search_exception_tables(exception_era(regs));
  13. if (fixup) {
  14. regs->csr_era = fixup->fixup;
  15. return 1;
  16. }
  17. return 0;
  18. }