Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mm/extable.c |
| 3 | */ |
| 4 | #include <linux/module.h> |
Russell King | 33fa9b1 | 2008-09-06 11:35:55 +0100 | [diff] [blame] | 5 | #include <linux/uaccess.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
| 7 | int fixup_exception(struct pt_regs *regs) |
| 8 | { |
| 9 | const struct exception_table_entry *fixup; |
| 10 | |
| 11 | fixup = search_exception_tables(instruction_pointer(regs)); |
Marc Zyngier | e16b31b | 2013-11-04 11:42:29 +0100 | [diff] [blame] | 12 | if (fixup) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | regs->ARM_pc = fixup->fixup; |
Marc Zyngier | e16b31b | 2013-11-04 11:42:29 +0100 | [diff] [blame] | 14 | #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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | return fixup != NULL; |
| 21 | } |