1*5c48b108SAl Viro /* 2*5c48b108SAl Viro * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 3*5c48b108SAl Viro * Licensed under the GPL 4*5c48b108SAl Viro */ 5*5c48b108SAl Viro 6*5c48b108SAl Viro #include "sysdep/ptrace.h" 7*5c48b108SAl Viro 8*5c48b108SAl Viro /* These two are from asm-um/uaccess.h and linux/module.h, check them. */ 9*5c48b108SAl Viro struct exception_table_entry 10*5c48b108SAl Viro { 11*5c48b108SAl Viro unsigned long insn; 12*5c48b108SAl Viro unsigned long fixup; 13*5c48b108SAl Viro }; 14*5c48b108SAl Viro 15*5c48b108SAl Viro const struct exception_table_entry *search_exception_tables(unsigned long add); 16*5c48b108SAl Viro 17*5c48b108SAl Viro /* Compare this to arch/i386/mm/extable.c:fixup_exception() */ 18*5c48b108SAl Viro int arch_fixup(unsigned long address, struct uml_pt_regs *regs) 19*5c48b108SAl Viro { 20*5c48b108SAl Viro const struct exception_table_entry *fixup; 21*5c48b108SAl Viro 22*5c48b108SAl Viro fixup = search_exception_tables(address); 23*5c48b108SAl Viro if (fixup != 0) { 24*5c48b108SAl Viro UPT_IP(regs) = fixup->fixup; 25*5c48b108SAl Viro return 1; 26*5c48b108SAl Viro } 27*5c48b108SAl Viro return 0; 28*5c48b108SAl Viro } 29