ucontext.h 1.7 KB

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