sigcontext.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #ifndef __SYSDEP_X86_64_SIGCONTEXT_H
  7. #define __SYSDEP_X86_64_SIGCONTEXT_H
  8. #include <sysdep/sc.h>
  9. #define IP_RESTART_SYSCALL(ip) ((ip) -= 2)
  10. #define SC_RESTART_SYSCALL(sc) IP_RESTART_SYSCALL(SC_IP(sc))
  11. #define SC_SET_SYSCALL_RETURN(sc, result) SC_RAX(sc) = (result)
  12. #define SC_FAULT_ADDR(sc) SC_CR2(sc)
  13. #define SC_FAULT_TYPE(sc) SC_ERR(sc)
  14. #define GET_FAULTINFO_FROM_SC(fi,sc) \
  15. { \
  16. (fi).cr2 = SC_CR2(sc); \
  17. (fi).error_code = SC_ERR(sc); \
  18. (fi).trap_no = SC_TRAPNO(sc); \
  19. }
  20. /* ptrace expects that, at the start of a system call, %eax contains
  21. * -ENOSYS, so this makes it so.
  22. */
  23. #define SC_START_SYSCALL(sc) do SC_RAX(sc) = -ENOSYS; while(0)
  24. /* This is Page Fault */
  25. #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
  26. extern unsigned long *sc_sigmask(void *sc_ptr);
  27. #endif
  28. /*
  29. * Overrides for Emacs so that we follow Linus's tabbing style.
  30. * Emacs will notice this stuff at the end of the file and automatically
  31. * adjust the settings for this buffer only. This must remain at the end
  32. * of the file.
  33. * ---------------------------------------------------------------------------
  34. * Local variables:
  35. * c-file-style: "linux"
  36. * End:
  37. */