sigcontext.h 1.2 KB

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