fault.c 659 字节
Newer Older
L
Linus Torvalds 已提交
1
/* 
J
Jeff Dike 已提交
2
 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
L
Linus Torvalds 已提交
3 4 5
 * Licensed under the GPL
 */

6
#include <sysdep/ptrace.h>
L
Linus Torvalds 已提交
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)
L
Linus Torvalds 已提交
19 20 21 22
{
	const struct exception_table_entry *fixup;

	fixup = search_exception_tables(address);
S
Sasha Levin 已提交
23
	if (fixup) {
J
Jeff Dike 已提交
24
		UPT_IP(regs) = fixup->fixup;
J
Jeff Dike 已提交
25
		return 1;
L
Linus Torvalds 已提交
26
	}
J
Jeff Dike 已提交
27
	return 0;
L
Linus Torvalds 已提交
28
}