fault.c 677 B

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