15c48b108SAl Viro /* 25c48b108SAl Viro * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 35c48b108SAl Viro * Licensed under the GPL 45c48b108SAl Viro */ 55c48b108SAl Viro 6*9ffc6724STiwei Bie #include <arch.h> 737185b33SAl Viro #include <sysdep/ptrace.h> 85c48b108SAl Viro 95c48b108SAl Viro /* These two are from asm-um/uaccess.h and linux/module.h, check them. */ 105c48b108SAl Viro struct exception_table_entry 115c48b108SAl Viro { 125c48b108SAl Viro unsigned long insn; 135c48b108SAl Viro unsigned long fixup; 145c48b108SAl Viro }; 155c48b108SAl Viro 165c48b108SAl Viro const struct exception_table_entry *search_exception_tables(unsigned long add); 175c48b108SAl Viro 185c48b108SAl Viro /* Compare this to arch/i386/mm/extable.c:fixup_exception() */ 195c48b108SAl Viro int arch_fixup(unsigned long address, struct uml_pt_regs *regs) 205c48b108SAl Viro { 215c48b108SAl Viro const struct exception_table_entry *fixup; 225c48b108SAl Viro 235c48b108SAl Viro fixup = search_exception_tables(address); 247be0b065SSasha Levin if (fixup) { 255c48b108SAl Viro UPT_IP(regs) = fixup->fixup; 265c48b108SAl Viro return 1; 275c48b108SAl Viro } 285c48b108SAl Viro return 0; 295c48b108SAl Viro } 30