ucontext.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/cris 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. #include <bits/sigcontext.h>
  21. /* Type for general register. */
  22. typedef long int greg_t;
  23. /* Number of general registers. */
  24. #define NGREG 20
  25. /* Container for all general registers. */
  26. typedef greg_t gregset_t[NGREG];
  27. /* Number of each register is the `gregset_t' array. */
  28. enum
  29. {
  30. R0 = 0,
  31. #define R0 R0
  32. R1 = 1,
  33. #define R1 R1
  34. R2 = 2,
  35. #define R2 R2
  36. R3 = 3,
  37. #define R3 R3
  38. R4 = 4,
  39. #define R4 R4
  40. R5 = 5,
  41. #define R5 R5
  42. R6 = 6,
  43. #define R6 R6
  44. R7 = 7,
  45. #define R7 R7
  46. R8 = 8,
  47. #define R8 R8
  48. R9 = 9,
  49. #define R9 R9
  50. R10 = 10,
  51. #define R10 R10
  52. R11 = 11,
  53. #define R11 R11
  54. R12 = 12,
  55. #define R12 R12
  56. R13 = 13,
  57. #define R13 R13
  58. R14 = 14,
  59. #define R14 R14
  60. R15 = 15,
  61. #define R15 R15
  62. R_SP = R14,
  63. #define R_SP R_SP
  64. R_PC = R15,
  65. #define R_PC R_PC
  66. };
  67. /* A placeholder; CRIS does not have any fp regs. */
  68. typedef unsigned long fpregset_t;
  69. /* A machine context is exactly a sigcontext. */
  70. typedef struct sigcontext mcontext_t;
  71. /* Userlevel context. */
  72. typedef struct ucontext
  73. {
  74. unsigned long int uc_flags;
  75. struct ucontext *uc_link;
  76. stack_t uc_stack;
  77. mcontext_t uc_mcontext;
  78. __sigset_t uc_sigmask;
  79. } ucontext_t;
  80. #endif /* sys/ucontext.h */