blob: fc33564597b8c3bd89fe74b3a7c42866c193eef0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * linux/arch/arm/mm/extable.c
4 */
Paul Gortmaker0ea93652016-07-23 14:01:45 -04005#include <linux/extable.h>
Russell King33fa9b12008-09-06 11:35:55 +01006#include <linux/uaccess.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8int fixup_exception(struct pt_regs *regs)
9{
10 const struct exception_table_entry *fixup;
11
12 fixup = search_exception_tables(instruction_pointer(regs));
Marc Zyngiere16b31b2013-11-04 11:42:29 +010013 if (fixup) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 regs->ARM_pc = fixup->fixup;
Marc Zyngiere16b31b2013-11-04 11:42:29 +010015#ifdef CONFIG_THUMB2_KERNEL
16 /* Clear the IT state to avoid nasty surprises in the fixup */
17 regs->ARM_cpsr &= ~PSR_IT_MASK;
18#endif
19 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21 return fixup != NULL;
22}