home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / ucontext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  1.7 KB  |  80 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_UCONTEXT_H
  11. #define _SYS_UCONTEXT_H
  12.  
  13. #ident    "@(#)/usr/include/sys/ucontext.h.sl 1.1 4.0 12/08/90 2556 AT&T-USL"
  14.  
  15. #include <sys/types.h>
  16. #include <sys/regset.h>
  17. #include <sys/signal.h>
  18. #include <sys/user.h>
  19.  
  20. typedef struct {
  21.     gregset_t    gregs;    /* general register set */
  22.     fpregset_t     fpregs;    /* floating point register set */
  23. } mcontext_t;
  24.  
  25. typedef struct ucontext {
  26.     u_long        uc_flags;
  27.     struct ucontext    *uc_link;
  28.     sigset_t       uc_sigmask;
  29.     stack_t     uc_stack;
  30.     mcontext_t     uc_mcontext;
  31.     long        uc_filler[5];    /* pad structure to 512 bytes */
  32. } ucontext_t;
  33.  
  34. #define GETCONTEXT    0
  35. #define SETCONTEXT    1
  36.  
  37. /* 
  38.  * values for uc_flags
  39.  * these are implementation dependent flags, that should be hidden
  40.  * from the user interface, defining which elements of ucontext
  41.  * are valid, and should be restored on call to setcontext
  42.  */
  43.  
  44. #define    UC_SIGMASK    001
  45. #define    UC_STACK    002
  46. #define    UC_CPU        004
  47. #define    UC_FP        010
  48.  
  49. #ifdef WEITEK
  50. #define UC_WEITEK    020
  51. #endif /* WEITEK */
  52.  
  53.  
  54. #ifdef WEITEK
  55. #define UC_MCONTEXT (UC_CPU|UC_FP|UC_WEITEK)
  56. #else
  57. #define UC_MCONTEXT (UC_CPU|UC_FP)
  58. #endif /* WEITEK */
  59.  
  60.  
  61.  
  62. /* 
  63.  * UC_ALL specifies the default context
  64.  */
  65.  
  66. #define UC_ALL        (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
  67.  
  68. #ifdef _KERNEL
  69.  
  70. #if defined(__STDC__)
  71. void savecontext(ucontext_t *, k_sigset_t);
  72. void restorecontext(ucontext_t *);
  73. #else
  74. void savecontext();
  75. void restorecontext();
  76. #endif
  77.  
  78. #endif
  79. #endif /* _SYS_UCONTEXT_H */
  80.