162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 362306a36Sopenharmony_ci * Licensed under the GPL 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#include <sysdep/ptrace.h> 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci/* These two are from asm-um/uaccess.h and linux/module.h, check them. */ 962306a36Sopenharmony_cistruct exception_table_entry 1062306a36Sopenharmony_ci{ 1162306a36Sopenharmony_ci unsigned long insn; 1262306a36Sopenharmony_ci unsigned long fixup; 1362306a36Sopenharmony_ci}; 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciconst struct exception_table_entry *search_exception_tables(unsigned long add); 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* Compare this to arch/i386/mm/extable.c:fixup_exception() */ 1862306a36Sopenharmony_ciint arch_fixup(unsigned long address, struct uml_pt_regs *regs) 1962306a36Sopenharmony_ci{ 2062306a36Sopenharmony_ci const struct exception_table_entry *fixup; 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci fixup = search_exception_tables(address); 2362306a36Sopenharmony_ci if (fixup) { 2462306a36Sopenharmony_ci UPT_IP(regs) = fixup->fixup; 2562306a36Sopenharmony_ci return 1; 2662306a36Sopenharmony_ci } 2762306a36Sopenharmony_ci return 0; 2862306a36Sopenharmony_ci} 29