sigframe.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef _ASM_X86_SIGFRAME_H
  2. #define _ASM_X86_SIGFRAME_H
  3. #include <asm/sigcontext.h>
  4. #include <asm/siginfo.h>
  5. #include <asm/ucontext.h>
  6. #include <linux/compat.h>
  7. #ifdef CONFIG_X86_32
  8. #define sigframe_ia32 sigframe
  9. #define rt_sigframe_ia32 rt_sigframe
  10. #define sigcontext_ia32 sigcontext
  11. #define _fpstate_ia32 _fpstate
  12. #define ucontext_ia32 ucontext
  13. #else /* !CONFIG_X86_32 */
  14. #ifdef CONFIG_IA32_EMULATION
  15. #include <asm/ia32.h>
  16. #endif /* CONFIG_IA32_EMULATION */
  17. #endif /* CONFIG_X86_32 */
  18. #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
  19. struct sigframe_ia32 {
  20. u32 pretcode;
  21. int sig;
  22. struct sigcontext_ia32 sc;
  23. /*
  24. * fpstate is unused. fpstate is moved/allocated after
  25. * retcode[] below. This movement allows to have the FP state and the
  26. * future state extensions (xsave) stay together.
  27. * And at the same time retaining the unused fpstate, prevents changing
  28. * the offset of extramask[] in the sigframe and thus prevent any
  29. * legacy application accessing/modifying it.
  30. */
  31. struct _fpstate_ia32 fpstate_unused;
  32. #ifdef CONFIG_IA32_EMULATION
  33. unsigned int extramask[_COMPAT_NSIG_WORDS-1];
  34. #else /* !CONFIG_IA32_EMULATION */
  35. unsigned long extramask[_NSIG_WORDS-1];
  36. #endif /* CONFIG_IA32_EMULATION */
  37. char retcode[8];
  38. /* fp state follows here */
  39. };
  40. struct rt_sigframe_ia32 {
  41. u32 pretcode;
  42. int sig;
  43. u32 pinfo;
  44. u32 puc;
  45. #ifdef CONFIG_IA32_EMULATION
  46. compat_siginfo_t info;
  47. #else /* !CONFIG_IA32_EMULATION */
  48. struct siginfo info;
  49. #endif /* CONFIG_IA32_EMULATION */
  50. struct ucontext_ia32 uc;
  51. char retcode[8];
  52. /* fp state follows here */
  53. };
  54. #endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
  55. #ifdef CONFIG_X86_64
  56. struct rt_sigframe {
  57. char __user *pretcode;
  58. struct ucontext uc;
  59. struct siginfo info;
  60. /* fp state follows here */
  61. };
  62. #ifdef CONFIG_X86_X32_ABI
  63. struct ucontext_x32 {
  64. unsigned int uc_flags;
  65. unsigned int uc_link;
  66. compat_stack_t uc_stack;
  67. unsigned int uc__pad0; /* needed for alignment */
  68. struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
  69. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  70. };
  71. struct rt_sigframe_x32 {
  72. u64 pretcode;
  73. struct ucontext_x32 uc;
  74. compat_siginfo_t info;
  75. /* fp state follows here */
  76. };
  77. #endif /* CONFIG_X86_X32_ABI */
  78. #endif /* CONFIG_X86_64 */
  79. #endif /* _ASM_X86_SIGFRAME_H */