ucontext.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /* H8/300 compliant context switching support. */
  16. #ifndef _SYS_UCONTEXT_H
  17. #define _SYS_UCONTEXT_H 1
  18. #include <features.h>
  19. #include <signal.h>
  20. typedef int greg_t;
  21. /* Number of general registers. */
  22. #define NFPREG 8
  23. /* Container for all general registers. */
  24. typedef greg_t gregset_t[NFPREG];
  25. #ifdef __USE_GNU
  26. /* Number of each register is the `gregset_t' array. */
  27. enum
  28. {
  29. ER0 = 0,
  30. #define ER0 ER0
  31. ER1 = 1,
  32. #define ER1 ER1
  33. ER2 = 2,
  34. #define ER2 ER2
  35. ER3 = 3,
  36. #define ER3 ER3
  37. ER4 = 4,
  38. #define ER4 ER4
  39. ER5 = 5,
  40. #define ER5 ER5
  41. ER6 = 6,
  42. #define ER6 ER6
  43. ER7 = 7,
  44. #define ER7 ER7
  45. };
  46. #endif
  47. /* Context to describe whole processor state. */
  48. typedef struct
  49. {
  50. gregset_t gregs;
  51. } mcontext_t;
  52. /* Userlevel context. */
  53. typedef struct ucontext
  54. {
  55. unsigned long int uc_flags;
  56. struct ucontext *uc_link;
  57. stack_t uc_stack;
  58. mcontext_t uc_mcontext;
  59. __sigset_t uc_sigmask;
  60. } ucontext_t;
  61. #endif