18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (C) 2010, Tobias Klauser <tklauser@distanz.ch>
38c2ecf20Sopenharmony_ci * Copyright (C) 2009, Wind River Systems Inc
48c2ecf20Sopenharmony_ci *   Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
78c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
88c2ecf20Sopenharmony_ci * for more details.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/extable.h>
128c2ecf20Sopenharmony_ci#include <linux/uaccess.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciint fixup_exception(struct pt_regs *regs)
158c2ecf20Sopenharmony_ci{
168c2ecf20Sopenharmony_ci	const struct exception_table_entry *fixup;
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	fixup = search_exception_tables(regs->ea);
198c2ecf20Sopenharmony_ci	if (fixup) {
208c2ecf20Sopenharmony_ci		regs->ea = fixup->fixup;
218c2ecf20Sopenharmony_ci		return 1;
228c2ecf20Sopenharmony_ci	}
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci	return 0;
258c2ecf20Sopenharmony_ci}
26