ucontext.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* Copyright (C) 1997, 1999, 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 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. /* System V/blackfin ABI compliant context switching support. */
  16. #ifndef _SYS_UCONTEXT_H
  17. #define _SYS_UCONTEXT_H 1
  18. #include <features.h>
  19. #include <signal.h>
  20. /* Type for general register. */
  21. typedef int greg_t;
  22. /* Number of general registers. */
  23. #define NGREG 47
  24. /* Container for all general registers. */
  25. typedef greg_t gregset_t[NGREG];
  26. /* Number of each register is the `gregset_t' array. */
  27. enum
  28. {
  29. R0 = 0,
  30. #define R0 R0
  31. R1 = 1,
  32. #define R1 R1
  33. R2 = 2,
  34. #define R2 R2
  35. R3 = 3,
  36. #define R3 R3
  37. R4 = 4,
  38. #define R4 R4
  39. R5 = 5,
  40. #define R5 R5
  41. R6 = 6,
  42. #define R6 R6
  43. R7 = 7,
  44. #define R7 R7
  45. P0 = 8,
  46. #define P0 P0
  47. P1 = 9,
  48. #define P1 P1
  49. P2 = 10,
  50. #define P2 P2
  51. P3 = 11,
  52. #define P3 P3
  53. P4 = 12,
  54. #define P4 P4
  55. P5 = 13,
  56. #define P5 P5
  57. USP = 14,
  58. #define USP USP
  59. A0W = 15,
  60. #define A0W A0W
  61. A1W = 16,
  62. #define A1W A1W
  63. A0X = 17,
  64. #define A0X A0X
  65. A1X = 18,
  66. #define A1X A1X
  67. ASTAT = 19,
  68. #define ASTAT ASTAT
  69. RETS = 20,
  70. #define RETS RETS
  71. PC= 21,
  72. #define PC PC
  73. RETX = 22,
  74. #define RETX RETX
  75. FP = 23,
  76. #define FP FP
  77. I0 = 24,
  78. #define I0 I0
  79. I1 = 25,
  80. #define I1 I1
  81. I2 = 26,
  82. #define I2 I2
  83. I3 = 27,
  84. #define I3 I3
  85. M0 = 28,
  86. #define M0 M0
  87. M1 = 29,
  88. #define M1 M1
  89. M2 = 30,
  90. #define M2 M2
  91. M3 = 31,
  92. #define M3 M3
  93. L0 = 32,
  94. #define L0 L0
  95. L1 = 33,
  96. #define L1 L1
  97. L2 = 34,
  98. #define L2 L2
  99. L3 = 35,
  100. #define L3 L3
  101. B_0 = 36,
  102. #define B_0 B_0
  103. B1 = 37,
  104. #define B1 B1
  105. B2 = 38,
  106. #define B2 B2
  107. B3 = 39,
  108. #define B3 B3
  109. LC0 = 40,
  110. #define LC0 LC0
  111. LC1 = 41,
  112. #define LC1 LC1
  113. LT0 = 42,
  114. #define LT0 LT0
  115. LT1 = 43,
  116. #define LT1 LT1
  117. LB0 = 44,
  118. #define LB0 LB0
  119. LB1 = 45,
  120. #define LB1 LB1
  121. SEQSTAT = 46
  122. #define SEQSTAT SEQSTAT
  123. };
  124. /* Context to describe whole processor state. */
  125. typedef struct
  126. {
  127. int version;
  128. gregset_t gregs;
  129. } mcontext_t;
  130. /* Userlevel context. */
  131. typedef struct ucontext
  132. {
  133. unsigned long int uc_flags;
  134. struct ucontext *uc_link;
  135. stack_t uc_stack;
  136. mcontext_t uc_mcontext;
  137. __sigset_t uc_sigmask;
  138. } ucontext_t;
  139. #endif /* sys/ucontext.h */