18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 38c2ecf20Sopenharmony_ci * Licensed under the GPL 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#include <sysdep/ptrace.h> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci/* These two are from asm-um/uaccess.h and linux/module.h, check them. */ 98c2ecf20Sopenharmony_cistruct exception_table_entry 108c2ecf20Sopenharmony_ci{ 118c2ecf20Sopenharmony_ci unsigned long insn; 128c2ecf20Sopenharmony_ci unsigned long fixup; 138c2ecf20Sopenharmony_ci}; 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciconst struct exception_table_entry *search_exception_tables(unsigned long add); 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* Compare this to arch/i386/mm/extable.c:fixup_exception() */ 188c2ecf20Sopenharmony_ciint arch_fixup(unsigned long address, struct uml_pt_regs *regs) 198c2ecf20Sopenharmony_ci{ 208c2ecf20Sopenharmony_ci const struct exception_table_entry *fixup; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci fixup = search_exception_tables(address); 238c2ecf20Sopenharmony_ci if (fixup) { 248c2ecf20Sopenharmony_ci UPT_IP(regs) = fixup->fixup; 258c2ecf20Sopenharmony_ci return 1; 268c2ecf20Sopenharmony_ci } 278c2ecf20Sopenharmony_ci return 0; 288c2ecf20Sopenharmony_ci} 29