xref: /OK3568_Linux_fs/kernel/arch/nds32/mm/extable.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun // Copyright (C) 2005-2017 Andes Technology Corporation
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun #include <linux/extable.h>
5*4882a593Smuzhiyun #include <linux/uaccess.h>
6*4882a593Smuzhiyun 
fixup_exception(struct pt_regs * regs)7*4882a593Smuzhiyun int fixup_exception(struct pt_regs *regs)
8*4882a593Smuzhiyun {
9*4882a593Smuzhiyun 	const struct exception_table_entry *fixup;
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun 	fixup = search_exception_tables(instruction_pointer(regs));
12*4882a593Smuzhiyun 	if (fixup)
13*4882a593Smuzhiyun 		regs->ipc = fixup->fixup;
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun 	return fixup != NULL;
16*4882a593Smuzhiyun }
17