162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * linux/arch/arm/mm/extable.c 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci#include <linux/extable.h> 662306a36Sopenharmony_ci#include <linux/uaccess.h> 762306a36Sopenharmony_ci 862306a36Sopenharmony_ciint fixup_exception(struct pt_regs *regs) 962306a36Sopenharmony_ci{ 1062306a36Sopenharmony_ci const struct exception_table_entry *fixup; 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci fixup = search_exception_tables(instruction_pointer(regs)); 1362306a36Sopenharmony_ci if (fixup) { 1462306a36Sopenharmony_ci regs->ARM_pc = fixup->fixup; 1562306a36Sopenharmony_ci#ifdef CONFIG_THUMB2_KERNEL 1662306a36Sopenharmony_ci /* Clear the IT state to avoid nasty surprises in the fixup */ 1762306a36Sopenharmony_ci regs->ARM_cpsr &= ~PSR_IT_MASK; 1862306a36Sopenharmony_ci#endif 1962306a36Sopenharmony_ci } 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci return fixup != NULL; 2262306a36Sopenharmony_ci} 23