ucontext.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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, see
  13. <http://www.gnu.org/licenses/>. */
  14. /* System V/cris ABI compliant context switching support. */
  15. #ifndef _SYS_UCONTEXT_H
  16. #define _SYS_UCONTEXT_H 1
  17. #include <features.h>
  18. #include <signal.h>
  19. #include <bits/sigcontext.h>
  20. /* Type for general register. */
  21. typedef long int greg_t;
  22. /* Number of general registers. */
  23. #define NGREG 20
  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. R8 = 8,
  46. #define R8 R8
  47. R9 = 9,
  48. #define R9 R9
  49. R10 = 10,
  50. #define R10 R10
  51. R11 = 11,
  52. #define R11 R11
  53. R12 = 12,
  54. #define R12 R12
  55. R13 = 13,
  56. #define R13 R13
  57. R14 = 14,
  58. #define R14 R14
  59. R15 = 15,
  60. #define R15 R15
  61. R_SP = R14,
  62. #define R_SP R_SP
  63. R_PC = R15,
  64. #define R_PC R_PC
  65. };
  66. /* A placeholder; CRIS does not have any fp regs. */
  67. typedef unsigned long fpregset_t;
  68. /* A machine context is exactly a sigcontext. */
  69. typedef struct sigcontext mcontext_t;
  70. /* Userlevel context. */
  71. typedef struct ucontext
  72. {
  73. unsigned long int uc_flags;
  74. struct ucontext *uc_link;
  75. stack_t uc_stack;
  76. mcontext_t uc_mcontext;
  77. __sigset_t uc_sigmask;
  78. } ucontext_t;
  79. #endif /* sys/ucontext.h */