extable.c 539 B

123456789101112131415161718192021222324
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
  4. * Lennox Wu <lennox.wu@sunplusct.com>
  5. * Chen Liqin <liqin.chen@sunplusct.com>
  6. * Copyright (C) 2013 Regents of the University of California
  7. */
  8. #include <linux/extable.h>
  9. #include <linux/module.h>
  10. #include <linux/uaccess.h>
  11. int fixup_exception(struct pt_regs *regs)
  12. {
  13. const struct exception_table_entry *fixup;
  14. fixup = search_exception_tables(regs->epc);
  15. if (fixup) {
  16. regs->epc = fixup->fixup;
  17. return 1;
  18. }
  19. return 0;
  20. }