blob: ce85117fc64eeb6fc33f7e9534169372152e0634 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
Jeff Dike5d864562007-05-06 14:51:24 -07007#include "sysdep/ptrace.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Jeff Dike5d864562007-05-06 14:51:24 -07009/* These two are from asm-um/uaccess.h and linux/module.h, check them. */
10struct exception_table_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -070011{
Jeff Dike5d864562007-05-06 14:51:24 -070012 unsigned long insn;
13 unsigned long fixup;
14};
15
16const struct exception_table_entry *search_exception_tables(unsigned long add);
Jeff Dikeba180fd2007-10-16 01:27:00 -070017
Jeff Dike77bf4402007-10-16 01:26:58 -070018int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
Jeff Dike5d864562007-05-06 14:51:24 -070019{
20 const struct exception_table_entry *fixup;
21
22 fixup = search_exception_tables(address);
Jeff Dikeba180fd2007-10-16 01:27:00 -070023 if (fixup != 0) {
Jeff Dike5d864562007-05-06 14:51:24 -070024 UPT_IP(regs) = fixup->fixup;
Jeff Dikeba180fd2007-10-16 01:27:00 -070025 return 1;
Jeff Dike5d864562007-05-06 14:51:24 -070026 }
Jeff Dikeba180fd2007-10-16 01:27:00 -070027 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028}