ucontext.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* Copyright (C) 1999, 2000, 2001 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 Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. 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. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. /* Where is System V/SH ABI? */
  16. #ifndef _SYS_UCONTEXT_H
  17. #define _SYS_UCONTEXT_H 1
  18. #include <features.h>
  19. #include <signal.h>
  20. /* We need the signal context definitions even if they are not used
  21. included in <signal.h>. */
  22. #include <bits/sigcontext.h>
  23. typedef long long greg_t;
  24. /* Number of general registers. */
  25. #define NGREG 64
  26. /* Container for all general registers. */
  27. typedef greg_t gregset_t[NGREG];
  28. #ifdef __USE_GNU
  29. /* Number of each register is the `gregset_t' array. */
  30. enum
  31. {
  32. R0 = 0,
  33. #define R0 R0
  34. R1 = 1,
  35. #define R1 R1
  36. R2 = 2,
  37. #define R2 R2
  38. R3 = 3,
  39. #define R3 R3
  40. R4 = 4,
  41. #define R4 R4
  42. R5 = 5,
  43. #define R5 R5
  44. R6 = 6,
  45. #define R6 R6
  46. R7 = 7,
  47. #define R7 R7
  48. R8 = 8,
  49. #define R8 R8
  50. R9 = 9,
  51. #define R9 R9
  52. R10 = 10,
  53. #define R10 R10
  54. R11 = 11,
  55. #define R11 R11
  56. R12 = 12,
  57. #define R12 R12
  58. R13 = 13,
  59. #define R13 R13
  60. R14 = 14,
  61. #define R14 R14
  62. R15 = 15,
  63. #define R15 R15
  64. R16 = 16,
  65. #define R16 R16
  66. R17 = 17,
  67. #define R17 R17
  68. R18 = 18,
  69. #define R18 R18
  70. R19 = 19,
  71. #define R19 R19
  72. R20 = 20,
  73. #define R20 R20
  74. R21 = 21,
  75. #define R21 R21
  76. R22 = 22,
  77. #define R22 R22
  78. R23 = 23,
  79. #define R23 R23
  80. R24 = 24,
  81. #define R24 R24
  82. R25 = 25,
  83. #define R25 R25
  84. R26 = 26,
  85. #define R26 R26
  86. R27 = 27,
  87. #define R27 R27
  88. R28 = 28,
  89. #define R28 R28
  90. R29 = 29,
  91. #define R29 R29
  92. R30 = 30,
  93. #define R30 R30
  94. R31 = 31,
  95. #define R31 R31
  96. R32 = 32,
  97. #define R32 R32
  98. R33 = 33,
  99. #define R33 R33
  100. R34 = 34,
  101. #define R34 R34
  102. R35 = 35,
  103. #define R35 R35
  104. R36 = 36,
  105. #define R36 R36
  106. R37 = 37,
  107. #define R37 R37
  108. R38 = 38,
  109. #define R38 R38
  110. R39 = 39,
  111. #define R39 R39
  112. R40 = 40,
  113. #define R40 R40
  114. R41 = 41,
  115. #define R41 R41
  116. R42 = 42,
  117. #define R42 R42
  118. R43 = 43,
  119. #define R43 R43
  120. R44 = 44,
  121. #define R44 R44
  122. R45 = 45,
  123. #define R45 R45
  124. R46 = 46,
  125. #define R46 R46
  126. R47 = 47,
  127. #define R47 R47
  128. R48 = 48,
  129. #define R48 R48
  130. R49 = 49,
  131. #define R49 R49
  132. R50 = 50,
  133. #define R50 R50
  134. R51 = 51,
  135. #define R51 R51
  136. R52 = 52,
  137. #define R52 R52
  138. R53 = 53,
  139. #define R53 R53
  140. R54 = 54,
  141. #define R54 R54
  142. R55 = 55,
  143. #define R55 R55
  144. R56 = 56,
  145. #define R56 R56
  146. R57 = 57,
  147. #define R57 R57
  148. R58 = 58,
  149. #define R58 R58
  150. R59 = 59,
  151. #define R59 R59
  152. R60 = 60,
  153. #define R60 R60
  154. R61 = 61,
  155. #define R61 R61
  156. R62 = 62,
  157. #define R62 R62
  158. R63 = 63,
  159. #define R63 R63
  160. };
  161. #endif
  162. typedef int freg_t;
  163. /* Number of FPU registers. */
  164. #define NFPREG 32
  165. /* Structure to describe FPU registers. */
  166. typedef freg_t fpregset_t[NFPREG];
  167. /* Context to describe whole processor state. */
  168. typedef struct
  169. {
  170. gregset_t gregs;
  171. fpregset_t fpregs;
  172. unsigned long long sc_tregs[8];
  173. unsigned long long sc_pc;
  174. unsigned long long sc_sr;
  175. unsigned long long sc_fpscr;
  176. } mcontext_t;
  177. /* Userlevel context. */
  178. typedef struct ucontext
  179. {
  180. unsigned long int uc_flags;
  181. struct ucontext *uc_link;
  182. stack_t uc_stack;
  183. mcontext_t uc_mcontext;
  184. __sigset_t uc_sigmask;
  185. } ucontext_t;
  186. #endif /* sys/ucontext.h */