David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
| 10 | #include <linux/extable.h> |
| 11 | #include <linux/module.h> |
| 12 | #include <linux/uaccess.h> |
| 13 | |
| 14 | int fixup_exception(struct pt_regs *regs) |
| 15 | { |
| 16 | const struct exception_table_entry *fixup; |
| 17 | |
| 18 | fixup = search_exception_tables(regs->sepc); |
| 19 | if (fixup) { |
| 20 | regs->sepc = fixup->fixup; |
| 21 | return 1; |
| 22 | } |
| 23 | return 0; |
| 24 | } |