Blame view

arch/x86/um/fault.c 664 Bytes
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
  /* 
ba180fd43   Jeff Dike   uml: style fixes ...
2
   * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
4
   * Licensed under the GPL
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
  #include "sysdep/ptrace.h"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
7
8
9
10
11
12
13
14
15
16
  
  /* 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() */
77bf44003   Jeff Dike   uml: remove code ...
17
  int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18
  {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
21
  	const struct exception_table_entry *fixup;
  
  	fixup = search_exception_tables(address);
ba180fd43   Jeff Dike   uml: style fixes ...
22
  	if (fixup != 0) {
5d86456d3   Jeff Dike   uml: tidy fault code
23
  		UPT_IP(regs) = fixup->fixup;
ba180fd43   Jeff Dike   uml: style fixes ...
24
  		return 1;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25
  	}
ba180fd43   Jeff Dike   uml: style fixes ...
26
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
  }