ucontext.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* Copyright (C) 1998, 1999, 2001, 2006 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. /* We need the signal context definitions even if they are not used
  22. included in <signal.h>. */
  23. #include <bits/sigcontext.h>
  24. typedef int greg_t;
  25. /* Number of general registers. */
  26. #define NGREG 18
  27. /* Container for all general registers. */
  28. typedef elf_gregset_t gregset_t;
  29. /* Number of each register is the `gregset_t' array. */
  30. enum
  31. {
  32. R0 = 0,
  33. #define R0 R0
  34. R1 = 1,
  35. #define R1 R1
  36. R2 = 2,
  37. #define R2 R2
  38. R3 = 3,
  39. #define R3 R3
  40. R4 = 4,
  41. #define R4 R4
  42. R5 = 5,
  43. #define R5 R5
  44. R6 = 6,
  45. #define R6 R6
  46. R7 = 7,
  47. #define R7 R7
  48. R8 = 8,
  49. #define R8 R8
  50. R9 = 9,
  51. #define R9 R9
  52. R10 = 10,
  53. #define R10 R10
  54. R11 = 11,
  55. #define R11 R11
  56. R12 = 12,
  57. #define R12 R12
  58. R13 = 13,
  59. #define R13 R13
  60. R14 = 14,
  61. #define R14 R14
  62. R15 = 15
  63. #define R15 R15
  64. };
  65. /* Structure to describe FPU registers. */
  66. typedef elf_fpregset_t fpregset_t;
  67. /* Context to describe whole processor state. This only describes
  68. the core registers; coprocessor registers get saved elsewhere
  69. (e.g. in uc_regspace, or somewhere unspecified on the stack
  70. during non-RT signal handlers). */
  71. typedef struct sigcontext mcontext_t;
  72. /* Userlevel context. */
  73. typedef struct ucontext
  74. {
  75. unsigned long uc_flags;
  76. struct ucontext *uc_link;
  77. stack_t uc_stack;
  78. mcontext_t uc_mcontext;
  79. __sigset_t uc_sigmask;
  80. unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
  81. } ucontext_t;
  82. #endif /* sys/ucontext.h */