18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * linux/arch/arm/mm/extable.c 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci#include <linux/extable.h> 68c2ecf20Sopenharmony_ci#include <linux/uaccess.h> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciint fixup_exception(struct pt_regs *regs) 98c2ecf20Sopenharmony_ci{ 108c2ecf20Sopenharmony_ci const struct exception_table_entry *fixup; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci fixup = search_exception_tables(instruction_pointer(regs)); 138c2ecf20Sopenharmony_ci if (fixup) { 148c2ecf20Sopenharmony_ci regs->ARM_pc = (unsigned long)&fixup->fixup + fixup->fixup; 158c2ecf20Sopenharmony_ci#ifdef CONFIG_THUMB2_KERNEL 168c2ecf20Sopenharmony_ci /* Clear the IT state to avoid nasty surprises in the fixup */ 178c2ecf20Sopenharmony_ci regs->ARM_cpsr &= ~PSR_IT_MASK; 188c2ecf20Sopenharmony_ci#endif 198c2ecf20Sopenharmony_ci } 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci return fixup != NULL; 228c2ecf20Sopenharmony_ci} 23