xref: /linux/arch/arm/mm/extable.c (revision 2dbc0838bcf24ca59cabc3130cf3b1d6809cdcd4)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  *  linux/arch/arm/mm/extable.c
4  */
5 #include <linux/extable.h>
6 #include <linux/uaccess.h>
7 
8 int fixup_exception(struct pt_regs *regs)
9 {
10 	const struct exception_table_entry *fixup;
11 
12 	fixup = search_exception_tables(instruction_pointer(regs));
13 	if (fixup) {
14 		regs->ARM_pc = fixup->fixup;
15 #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 	}
20 
21 	return fixup != NULL;
22 }
23