xref: /linux/arch/nios2/mm/extable.c (revision 7e227e88187f871fcdc1e69cd7b56fd9a5a41ca5)
1862674d4SLey Foon Tan /*
2862674d4SLey Foon Tan  * Copyright (C) 2010, Tobias Klauser <tklauser@distanz.ch>
3862674d4SLey Foon Tan  * Copyright (C) 2009, Wind River Systems Inc
4862674d4SLey Foon Tan  *   Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
5862674d4SLey Foon Tan  *
6862674d4SLey Foon Tan  * This file is subject to the terms and conditions of the GNU General Public
7862674d4SLey Foon Tan  * License.  See the file "COPYING" in the main directory of this archive
8862674d4SLey Foon Tan  * for more details.
9862674d4SLey Foon Tan  */
10862674d4SLey Foon Tan 
11*7e227e88SPaul Gortmaker #include <linux/extable.h>
12862674d4SLey Foon Tan #include <linux/uaccess.h>
13862674d4SLey Foon Tan 
14862674d4SLey Foon Tan int fixup_exception(struct pt_regs *regs)
15862674d4SLey Foon Tan {
16862674d4SLey Foon Tan 	const struct exception_table_entry *fixup;
17862674d4SLey Foon Tan 
18862674d4SLey Foon Tan 	fixup = search_exception_tables(regs->ea);
19862674d4SLey Foon Tan 	if (fixup) {
20862674d4SLey Foon Tan 		regs->ea = fixup->fixup;
21862674d4SLey Foon Tan 		return 1;
22862674d4SLey Foon Tan 	}
23862674d4SLey Foon Tan 
24862674d4SLey Foon Tan 	return 0;
25862674d4SLey Foon Tan }
26