ucontext.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* Copyright (C) 1998, 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/ARM 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 <sys/procfs.h>
  21. typedef int greg_t;
  22. /* Number of general registers. */
  23. #define NGREG 16
  24. /* Container for all general registers. */
  25. typedef elf_gregset_t gregset_t;
  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. };
  62. /* Structure to describe FPU registers. */
  63. typedef elf_fpregset_t fpregset_t;
  64. /* Context to describe whole processor state. */
  65. typedef struct
  66. {
  67. gregset_t gregs;
  68. fpregset_t fpregs;
  69. } mcontext_t;
  70. /* Userlevel context. */
  71. typedef struct ucontext
  72. {
  73. unsigned long int uc_flags;
  74. struct ucontext *uc_link;
  75. __sigset_t uc_sigmask;
  76. stack_t uc_stack;
  77. mcontext_t uc_mcontext;
  78. long int uc_filler[5];
  79. } ucontext_t;
  80. #endif /* sys/ucontext.h */