xref: /OK3568_Linux_fs/kernel/arch/nios2/mm/extable.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (C) 2010, Tobias Klauser <tklauser@distanz.ch>
3*4882a593Smuzhiyun  * Copyright (C) 2009, Wind River Systems Inc
4*4882a593Smuzhiyun  *   Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
7*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
8*4882a593Smuzhiyun  * for more details.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/extable.h>
12*4882a593Smuzhiyun #include <linux/uaccess.h>
13*4882a593Smuzhiyun 
fixup_exception(struct pt_regs * regs)14*4882a593Smuzhiyun int fixup_exception(struct pt_regs *regs)
15*4882a593Smuzhiyun {
16*4882a593Smuzhiyun 	const struct exception_table_entry *fixup;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun 	fixup = search_exception_tables(regs->ea);
19*4882a593Smuzhiyun 	if (fixup) {
20*4882a593Smuzhiyun 		regs->ea = fixup->fixup;
21*4882a593Smuzhiyun 		return 1;
22*4882a593Smuzhiyun 	}
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun 	return 0;
25*4882a593Smuzhiyun }
26