Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
Al Viro | 37185b3 | 2012-10-08 03:27:32 +0100 | [diff] [blame^] | 6 | #include <sysdep/ptrace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 8 | /* These two are from asm-um/uaccess.h and linux/module.h, check them. */ |
| 9 | struct exception_table_entry |
| 10 | { |
| 11 | unsigned long insn; |
| 12 | unsigned long fixup; |
| 13 | }; |
| 14 | |
| 15 | const struct exception_table_entry *search_exception_tables(unsigned long add); |
| 16 | |
| 17 | /* Compare this to arch/i386/mm/extable.c:fixup_exception() */ |
Jeff Dike | 77bf440 | 2007-10-16 01:26:58 -0700 | [diff] [blame] | 18 | int arch_fixup(unsigned long address, struct uml_pt_regs *regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | const struct exception_table_entry *fixup; |
| 21 | |
| 22 | fixup = search_exception_tables(address); |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 23 | if (fixup != 0) { |
Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -0700 | [diff] [blame] | 24 | UPT_IP(regs) = fixup->fixup; |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 25 | return 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | } |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 27 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | } |