1 // SPDX-License-Identifier: GPL-2.0-or-later
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
10 #include <linux/extable.h>
11 #include <linux/module.h>
12 #include <linux/uaccess.h>
14 #if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
15 int rv_bpf_fixup_exception(const struct exception_table_entry *ex, struct pt_regs *regs);
18 int fixup_exception(struct pt_regs *regs)
20 const struct exception_table_entry *fixup;
22 fixup = search_exception_tables(regs->epc);
26 #if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
27 if (regs->epc >= BPF_JIT_REGION_START && regs->epc < BPF_JIT_REGION_END)
28 return rv_bpf_fixup_exception(fixup, regs);
31 regs->epc = fixup->fixup;