ucontext.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 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, see
  13. <http://www.gnu.org/licenses/>. */
  14. /* Where is System V/SH ABI? */
  15. #ifndef _SYS_UCONTEXT_H
  16. #define _SYS_UCONTEXT_H 1
  17. #include <features.h>
  18. #include <signal.h>
  19. /* We need the signal context definitions even if they are not used
  20. included in <signal.h>. */
  21. #include <bits/sigcontext.h>
  22. typedef int greg_t;
  23. /* Number of general registers. */
  24. #define NGREG 16
  25. /* Container for all general registers. */
  26. typedef greg_t gregset_t[NGREG];
  27. #ifdef __USE_GNU
  28. /* Number of each register is the `gregset_t' array. */
  29. enum
  30. {
  31. R0 = 0,
  32. #define R0 R0
  33. R1 = 1,
  34. #define R1 R1
  35. R2 = 2,
  36. #define R2 R2
  37. R3 = 3,
  38. #define R3 R3
  39. R4 = 4,
  40. #define R4 R4
  41. R5 = 5,
  42. #define R5 R5
  43. R6 = 6,
  44. #define R6 R6
  45. R7 = 7,
  46. #define R7 R7
  47. R8 = 8,
  48. #define R8 R8
  49. R9 = 9,
  50. #define R9 R9
  51. R10 = 10,
  52. #define R10 R10
  53. R11 = 11,
  54. #define R11 R11
  55. R12 = 12,
  56. #define R12 R12
  57. R13 = 13,
  58. #define R13 R13
  59. R14 = 14,
  60. #define R14 R14
  61. R15 = 15,
  62. #define R15 R15
  63. };
  64. #endif
  65. typedef int freg_t;
  66. /* Number of FPU registers. */
  67. #define NFPREG 16
  68. /* Structure to describe FPU registers. */
  69. typedef freg_t fpregset_t[NFPREG];
  70. /* Context to describe whole processor state. */
  71. typedef struct
  72. {
  73. unsigned int oldmask;
  74. /* CPU registers */
  75. gregset_t gregs;
  76. unsigned int pc;
  77. unsigned int pr;
  78. unsigned int sr;
  79. unsigned int gbr;
  80. unsigned int mach;
  81. unsigned int macl;
  82. #ifdef __SH4__
  83. /* FPU registers */
  84. fpregset_t fpregs;
  85. fpregset_t xfpregs;
  86. unsigned int fpscr;
  87. unsigned int fpul;
  88. unsigned int ownedfp;
  89. #endif
  90. } mcontext_t;
  91. /* Userlevel context. */
  92. typedef struct ucontext
  93. {
  94. unsigned long int uc_flags;
  95. struct ucontext *uc_link;
  96. stack_t uc_stack;
  97. mcontext_t uc_mcontext;
  98. __sigset_t uc_sigmask;
  99. } ucontext_t;
  100. #endif /* sys/ucontext.h */