ucontext.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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, see
  13. <http://www.gnu.org/licenses/>. */
  14. /* Linux/AVR32 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 <sys/procfs.h>
  20. #include <bits/sigcontext.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 sigcontext mcontext_t;
  66. /* Userlevel context. */
  67. typedef struct ucontext
  68. {
  69. unsigned long uc_flags;
  70. struct ucontext *uc_link;
  71. stack_t uc_stack;
  72. mcontext_t uc_mcontext;
  73. sigset_t uc_sigmask; /* mask last for extensibility */
  74. } ucontext_t;
  75. #endif /* sys/ucontext.h */