blob: 2fc72942215155b0e92e32d833e1d2e302ebe01d [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-or-later
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
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 Scullb4b6d4a2019-01-02 15:54:55 +00007 */
8
9
10#include <linux/extable.h>
11#include <linux/module.h>
12#include <linux/uaccess.h>
13
14int fixup_exception(struct pt_regs *regs)
15{
16 const struct exception_table_entry *fixup;
17
Olivier Deprez157378f2022-04-04 15:47:50 +020018 fixup = search_exception_tables(regs->epc);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000019 if (fixup) {
Olivier Deprez157378f2022-04-04 15:47:50 +020020 regs->epc = fixup->fixup;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000021 return 1;
22 }
23 return 0;
24}