ucontext.h 3.3 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. REG_R0 = 0,
  30. #define REG_R0 REG_R0
  31. REG_R1 = 1,
  32. #define REG_R1 REG_R1
  33. REG_R2 = 2,
  34. #define REG_R2 REG_R2
  35. REG_R3 = 3,
  36. #define REG_R3 REG_R3
  37. REG_R4 = 4,
  38. #define REG_R4 REG_R4
  39. REG_R5 = 5,
  40. #define REG_R5 REG_R5
  41. REG_R6 = 6,
  42. #define REG_R6 REG_R6
  43. REG_R7 = 7,
  44. #define REG_R7 REG_R7
  45. REG_P0 = 8,
  46. #define REG_P0 REG_P0
  47. REG_P1 = 9,
  48. #define REG_P1 REG_P1
  49. REG_P2 = 10,
  50. #define REG_P2 REG_P2
  51. REG_P3 = 11,
  52. #define REG_P3 REG_P3
  53. REG_P4 = 12,
  54. #define REG_P4 REG_P4
  55. REG_P5 = 13,
  56. #define REG_P5 REG_P5
  57. REG_USP = 14,
  58. #define REG_USP REG_USP
  59. REG_A0W = 15,
  60. #define REG_A0W REG_A0W
  61. REG_A1W = 16,
  62. #define REG_A1W REG_A1W
  63. REG_A0X = 17,
  64. #define REG_A0X REG_A0X
  65. REG_A1X = 18,
  66. #define REG_A1X REG_A1X
  67. REG_ASTAT = 19,
  68. #define REG_ASTAT REG_ASTAT
  69. REG_RETS = 20,
  70. #define REG_RETS REG_RETS
  71. REG_PC= 21,
  72. #define REG_PC REG_PC
  73. REG_RETX = 22,
  74. #define REG_RETX REG_RETX
  75. REG_FP = 23,
  76. #define REG_FP REG_FP
  77. REG_I0 = 24,
  78. #define REG_I0 REG_I0
  79. REG_I1 = 25,
  80. #define REG_I1 REG_I1
  81. REG_I2 = 26,
  82. #define REG_I2 REG_I2
  83. REG_I3 = 27,
  84. #define REG_I3 REG_I3
  85. REG_M0 = 28,
  86. #define REG_M0 REG_M0
  87. REG_M1 = 29,
  88. #define REG_M1 REG_M1
  89. REG_M2 = 30,
  90. #define REG_M2 REG_M2
  91. REG_M3 = 31,
  92. #define REG_M3 REG_M3
  93. REG_L0 = 32,
  94. #define REG_L0 REG_L0
  95. REG_L1 = 33,
  96. #define REG_L1 REG_L1
  97. REG_L2 = 34,
  98. #define REG_L2 REG_L2
  99. REG_L3 = 35,
  100. #define REG_L3 REG_L3
  101. REG_B_0 = 36,
  102. #define REG_B_0 REG_B_0
  103. REG_B1 = 37,
  104. #define REG_B1 REG_B1
  105. REG_B2 = 38,
  106. #define REG_B2 REG_B2
  107. REG_B3 = 39,
  108. #define REG_B3 REG_B3
  109. REG_LC0 = 40,
  110. #define REG_LC0 REG_LC0
  111. REG_LC1 = 41,
  112. #define REG_LC1 REG_LC1
  113. REG_LT0 = 42,
  114. #define REG_LT0 REG_LT0
  115. REG_LT1 = 43,
  116. #define REG_LT1 REG_LT1
  117. REG_LB0 = 44,
  118. #define REG_LB0 REG_LB0
  119. REG_LB1 = 45,
  120. #define REG_LB1 REG_LB1
  121. REG_SEQSTAT = 46
  122. #define REG_SEQSTAT REG_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 */