fault.c 659 Bytes
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
/* 
Jeff Dike's avatar
Jeff Dike committed
2
 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Linus Torvalds's avatar
Linus Torvalds committed
3
4
5
 * Licensed under the GPL
 */

6
#include <sysdep/ptrace.h>
Linus Torvalds's avatar
Linus Torvalds committed
7
8
9
10
11
12
13
14
15
16
17

/* These two are from asm-um/uaccess.h and linux/module.h, check them. */
struct exception_table_entry
{
	unsigned long insn;
	unsigned long fixup;
};

const struct exception_table_entry *search_exception_tables(unsigned long add);

/* Compare this to arch/i386/mm/extable.c:fixup_exception() */
18
int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
Linus Torvalds's avatar
Linus Torvalds committed
19
20
21
22
{
	const struct exception_table_entry *fixup;

	fixup = search_exception_tables(address);
Sasha Levin's avatar
Sasha Levin committed
23
	if (fixup) {
Jeff Dike's avatar
Jeff Dike committed
24
		UPT_IP(regs) = fixup->fixup;
Jeff Dike's avatar
Jeff Dike committed
25
		return 1;
Linus Torvalds's avatar
Linus Torvalds committed
26
	}
Jeff Dike's avatar
Jeff Dike committed
27
	return 0;
Linus Torvalds's avatar
Linus Torvalds committed
28
}