fault.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2002 - 2004 Jeff Dike (jdike@addtoit.com)
  3. * Licensed under the GPL
  4. */
  5. #include <signal.h>
  6. #include "sysdep/ptrace.h"
  7. #include "sysdep/sigcontext.h"
  8. /* These two are from asm-um/uaccess.h and linux/module.h, check them. */
  9. struct exception_table_entry
  10. {
  11. unsigned long insn;
  12. unsigned long fixup;
  13. };
  14. const struct exception_table_entry *search_exception_tables(unsigned long add);
  15. /* Compare this to arch/i386/mm/extable.c:fixup_exception() */
  16. int arch_fixup(unsigned long address, void *sc_ptr)
  17. {
  18. struct sigcontext *sc = sc_ptr;
  19. const struct exception_table_entry *fixup;
  20. fixup = search_exception_tables(address);
  21. if(fixup != 0){
  22. sc->eip = fixup->fixup;
  23. return(1);
  24. }
  25. return(0);
  26. }
  27. /*
  28. * Overrides for Emacs so that we follow Linus's tabbing style.
  29. * Emacs will notice this stuff at the end of the file and automatically
  30. * adjust the settings for this buffer only. This must remain at the end
  31. * of the file.
  32. * ---------------------------------------------------------------------------
  33. * Local variables:
  34. * c-file-style: "linux"
  35. * End:
  36. */