blob: 312e15e6d00b8a6b909747305166e1bc7f581bf0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mm/extable.c
3 */
4#include <linux/module.h>
Russell King33fa9b12008-09-06 11:35:55 +01005#include <linux/uaccess.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7int fixup_exception(struct pt_regs *regs)
8{
9 const struct exception_table_entry *fixup;
10
11 fixup = search_exception_tables(instruction_pointer(regs));
Marc Zyngiere16b31b2013-11-04 11:42:29 +010012 if (fixup) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 regs->ARM_pc = fixup->fixup;
Marc Zyngiere16b31b2013-11-04 11:42:29 +010014#ifdef CONFIG_THUMB2_KERNEL
15 /* Clear the IT state to avoid nasty surprises in the fixup */
16 regs->ARM_cpsr &= ~PSR_IT_MASK;
17#endif
18 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20 return fixup != NULL;
21}