| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2003 PathScale, Inc. | ||||
| 3 | * | ||||
| 4 | * Licensed under the GPL | ||||
| 5 | */ | ||||
| 6 | |||||
| Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -0700 | [diff] [blame] | 7 | #include "sysdep/ptrace.h" |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -0700 | [diff] [blame] | 9 | /* These two are from asm-um/uaccess.h and linux/module.h, check them. */ |
| 10 | struct exception_table_entry | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | { |
| Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -0700 | [diff] [blame] | 12 | unsigned long insn; |
| 13 | unsigned long fixup; | ||||
| 14 | }; | ||||
| 15 | |||||
| 16 | const struct exception_table_entry *search_exception_tables(unsigned long add); | ||||
| Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 17 | |
| Jeff Dike | 77bf440 | 2007-10-16 01:26:58 -0700 | [diff] [blame] | 18 | int arch_fixup(unsigned long address, struct uml_pt_regs *regs) |
| Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -0700 | [diff] [blame] | 19 | { |
| 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; |
| Jeff Dike | 5d86456 | 2007-05-06 14:51:24 -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 | } |