sigcontext.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* Copyright (C) 2002 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _BITS_SIGCONTEXT_H
  16. #define _BITS_SIGCONTEXT_H 1
  17. #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
  18. # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
  19. #endif
  20. #include <bits/wordsize.h>
  21. struct _fpreg
  22. {
  23. unsigned short significand[4];
  24. unsigned short exponent;
  25. };
  26. struct _fpxreg
  27. {
  28. unsigned short significand[4];
  29. unsigned short exponent;
  30. unsigned short padding[3];
  31. };
  32. struct _xmmreg
  33. {
  34. __uint32_t element[4];
  35. };
  36. #if __WORDSIZE == 32
  37. struct _fpstate
  38. {
  39. /* Regular FPU environment. */
  40. __uint32_t cw;
  41. __uint32_t sw;
  42. __uint32_t tag;
  43. __uint32_t ipoff;
  44. __uint32_t cssel;
  45. __uint32_t dataoff;
  46. __uint32_t datasel;
  47. struct _fpreg _st[8];
  48. unsigned short status;
  49. unsigned short magic;
  50. /* FXSR FPU environment. */
  51. __uint32_t _fxsr_env[6];
  52. __uint32_t mxcsr;
  53. __uint32_t reserved;
  54. struct _fpxreg _fxsr_st[8];
  55. struct _xmmreg _xmm[8];
  56. __uint32_t padding[56];
  57. };
  58. struct sigcontext
  59. {
  60. unsigned short gs, __gsh;
  61. unsigned short fs, __fsh;
  62. unsigned short es, __esh;
  63. unsigned short ds, __dsh;
  64. unsigned long edi;
  65. unsigned long esi;
  66. unsigned long ebp;
  67. unsigned long esp;
  68. unsigned long ebx;
  69. unsigned long edx;
  70. unsigned long ecx;
  71. unsigned long eax;
  72. unsigned long trapno;
  73. unsigned long err;
  74. unsigned long eip;
  75. unsigned short cs, __csh;
  76. unsigned long eflags;
  77. unsigned long esp_at_signal;
  78. unsigned short ss, __ssh;
  79. struct _fpstate * fpstate;
  80. unsigned long oldmask;
  81. unsigned long cr2;
  82. };
  83. #else /* __WORDSIZE == 64 */
  84. struct _fpstate
  85. {
  86. /* FPU environment matching the 64-bit FXSAVE layout. */
  87. __uint16_t cwd;
  88. __uint16_t swd;
  89. __uint16_t ftw;
  90. __uint16_t fop;
  91. __uint64_t rip;
  92. __uint64_t rdp;
  93. __uint32_t mxcsr;
  94. __uint32_t mxcr_mask;
  95. struct _fpxreg _st[8];
  96. struct _xmmreg _xmm[16];
  97. __uint32_t padding[24];
  98. };
  99. struct sigcontext
  100. {
  101. unsigned long r8;
  102. unsigned long r9;
  103. unsigned long r10;
  104. unsigned long r11;
  105. unsigned long r12;
  106. unsigned long r13;
  107. unsigned long r14;
  108. unsigned long r15;
  109. unsigned long rdi;
  110. unsigned long rsi;
  111. unsigned long rbp;
  112. unsigned long rbx;
  113. unsigned long rdx;
  114. unsigned long rax;
  115. unsigned long rcx;
  116. unsigned long rsp;
  117. unsigned long rip;
  118. unsigned long eflags;
  119. unsigned short cs;
  120. unsigned short gs;
  121. unsigned short fs;
  122. unsigned short __pad0;
  123. unsigned long err;
  124. unsigned long trapno;
  125. unsigned long oldmask;
  126. unsigned long cr2;
  127. struct _fpstate * fpstate;
  128. unsigned long __reserved1 [8];
  129. };
  130. #endif /* __WORDSIZE == 64 */
  131. #endif /* _BITS_SIGCONTEXT_H */