fault.c 659 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #include <sysdep/ptrace.h>
  6. /* These two are from asm-um/uaccess.h and linux/module.h, check them. */
  7. struct exception_table_entry
  8. {
  9. unsigned long insn;
  10. unsigned long fixup;
  11. };
  12. const struct exception_table_entry *search_exception_tables(unsigned long add);
  13. /* Compare this to arch/i386/mm/extable.c:fixup_exception() */
  14. int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
  15. {
  16. const struct exception_table_entry *fixup;
  17. fixup = search_exception_tables(address);
  18. if (fixup) {
  19. UPT_IP(regs) = fixup->fixup;
  20. return 1;
  21. }
  22. return 0;
  23. }