ucontext.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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/m68k 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 18
  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. R_D0 = 0,
  30. #define R_D0 R_D0
  31. R_D1 = 1,
  32. #define R_D1 R_D1
  33. R_D2 = 2,
  34. #define R_D2 R_D2
  35. R_D3 = 3,
  36. #define R_D3 R_D3
  37. R_D4 = 4,
  38. #define R_D4 R_D4
  39. R_D5 = 5,
  40. #define R_D5 R_D5
  41. R_D6 = 6,
  42. #define R_D6 R_D6
  43. R_D7 = 7,
  44. #define R_D7 R_D7
  45. R_A0 = 8,
  46. #define R_A0 R_A0
  47. R_A1 = 9,
  48. #define R_A1 R_A1
  49. R_A2 = 10,
  50. #define R_A2 R_A2
  51. R_A3 = 11,
  52. #define R_A3 R_A3
  53. R_A4 = 12,
  54. #define R_A4 R_A4
  55. R_A5 = 13,
  56. #define R_A5 R_A5
  57. R_A6 = 14,
  58. #define R_A6 R_A6
  59. R_A7 = 15,
  60. #define R_A7 R_A7
  61. R_SP = 15,
  62. #define R_SP R_SP
  63. R_PC = 16,
  64. #define R_PC R_PC
  65. R_PS = 17
  66. #define R_PS R_PS
  67. };
  68. /* Structure to describe FPU registers. */
  69. typedef struct fpregset
  70. {
  71. int f_fpregs[8][3];
  72. int f_pcr;
  73. int f_psr;
  74. int f_fpiaddr;
  75. } fpregset_t;
  76. /* Context to describe whole processor state. */
  77. typedef struct
  78. {
  79. int version;
  80. gregset_t gregs;
  81. fpregset_t fpregs;
  82. } mcontext_t;
  83. #define MCONTEXT_VERSION 2
  84. /* Userlevel context. */
  85. typedef struct ucontext
  86. {
  87. unsigned long int uc_flags;
  88. struct ucontext *uc_link;
  89. __sigset_t uc_sigmask;
  90. stack_t uc_stack;
  91. mcontext_t uc_mcontext;
  92. long int uc_filler[174];
  93. } ucontext_t;
  94. #endif /* sys/ucontext.h */