Print this page
XXX AVX procfs


  55         unsigned long   __sigbits[4];
  56 } sigset_t;
  57 #endif /* _SIGSET_T */
  58 
  59 #ifndef _STACK_T
  60 #define _STACK_T
  61 typedef struct {
  62         void    *ss_sp;
  63         size_t  ss_size;
  64         int     ss_flags;
  65 } stack_t;
  66 #endif /* _STACK_T */
  67 #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
  68 
  69 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  70 typedef struct ucontext ucontext_t;
  71 #else
  72 typedef struct __ucontext ucontext_t;
  73 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
  74 







  75 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  76 struct  ucontext {
  77 #else
  78 struct  __ucontext {
  79 #endif
  80         unsigned long   uc_flags;
  81         ucontext_t      *uc_link;
  82         sigset_t        uc_sigmask;
  83         stack_t         uc_stack;
  84         mcontext_t      uc_mcontext;
  85         long            uc_filler[5];   /* see ABI spec for Intel386 */

  86 };
  87 
  88 #if defined(_SYSCALL32)
  89 





  90 /* Kernel view of user ILP32 ucontext structure */
  91 
  92 typedef struct ucontext32 {
  93         uint32_t        uc_flags;
  94         caddr32_t       uc_link;
  95         sigset_t        uc_sigmask;
  96         stack32_t       uc_stack;
  97         mcontext32_t    uc_mcontext;
  98         int32_t         uc_filler[5];

  99 } ucontext32_t;
 100 
 101 #if defined(_KERNEL)
 102 extern void ucontext_nto32(const ucontext_t *src, ucontext32_t *dest);
 103 extern void ucontext_32ton(const ucontext32_t *src, ucontext_t *dest);
 104 #endif
 105 
 106 #endif  /* _SYSCALL32 */
 107 
 108 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 109 #define GETCONTEXT      0
 110 #define SETCONTEXT      1
 111 #define GETUSTACK       2
 112 #define SETUSTACK       3
 113 
 114 /*
 115  * values for uc_flags
 116  * these are implementation dependent flags, that should be hidden
 117  * from the user interface, defining which elements of ucontext
 118  * are valid, and should be restored on call to setcontext
 119  */
 120 
 121 #define UC_SIGMASK      0x01
 122 #define UC_STACK        0x02
 123 #define UC_CPU          0x04
 124 #define UC_MAU          0x08

 125 #define UC_FPU          UC_MAU
 126 
 127 #define UC_MCONTEXT     (UC_CPU|UC_FPU)
 128 
 129 /*
 130  * UC_ALL specifies the default context
 131  */
 132 
 133 #define UC_ALL          (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
 134 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 135 
 136 #ifdef _KERNEL
 137 void savecontext(ucontext_t *, const k_sigset_t *);
 138 void restorecontext(ucontext_t *);
 139 
 140 #ifdef _SYSCALL32
 141 extern void savecontext32(ucontext32_t *, const k_sigset_t *);
 142 #endif
 143 #endif
 144 


  55         unsigned long   __sigbits[4];
  56 } sigset_t;
  57 #endif /* _SIGSET_T */
  58 
  59 #ifndef _STACK_T
  60 #define _STACK_T
  61 typedef struct {
  62         void    *ss_sp;
  63         size_t  ss_size;
  64         int     ss_flags;
  65 } stack_t;
  66 #endif /* _STACK_T */
  67 #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
  68 
  69 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  70 typedef struct ucontext ucontext_t;
  71 #else
  72 typedef struct __ucontext ucontext_t;
  73 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
  74 
  75 #define XRS_ID  0x00737278      /* the string "xrs" */
  76 
  77 typedef struct {
  78         unsigned long   xrs_id;
  79         caddr_t         xrs_ptr;
  80 } xrs_t;
  81 
  82 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  83 struct  ucontext {
  84 #else
  85 struct  __ucontext {
  86 #endif
  87         unsigned long   uc_flags;
  88         ucontext_t      *uc_link;
  89         sigset_t        uc_sigmask;
  90         stack_t         uc_stack;
  91         mcontext_t      uc_mcontext;
  92         xrs_t           uc_xrs;
  93         long            uc_filler[3];   /* see ABI spec for Intel386 */
  94 };
  95 
  96 #if defined(_SYSCALL32)
  97 
  98 typedef struct {
  99         uint32_t        xrs_id;
 100         caddr32_t       xrs_ptr;
 101 } xrs32_t;
 102 
 103 /* Kernel view of user ILP32 ucontext structure */
 104 
 105 typedef struct ucontext32 {
 106         uint32_t        uc_flags;
 107         caddr32_t       uc_link;
 108         sigset_t        uc_sigmask;
 109         stack32_t       uc_stack;
 110         mcontext32_t    uc_mcontext;
 111         xrs32_t         uc_xrs;
 112         int32_t         uc_filler[3];
 113 } ucontext32_t;
 114 
 115 #if defined(_KERNEL)
 116 extern void ucontext_nto32(const ucontext_t *src, ucontext32_t *dest);
 117 extern void ucontext_32ton(const ucontext32_t *src, ucontext_t *dest);
 118 #endif
 119 
 120 #endif  /* _SYSCALL32 */
 121 
 122 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 123 #define GETCONTEXT      0
 124 #define SETCONTEXT      1
 125 #define GETUSTACK       2
 126 #define SETUSTACK       3
 127 
 128 /*
 129  * values for uc_flags
 130  * these are implementation dependent flags, that should be hidden
 131  * from the user interface, defining which elements of ucontext
 132  * are valid, and should be restored on call to setcontext
 133  */
 134 
 135 #define UC_SIGMASK      0x01
 136 #define UC_STACK        0x02
 137 #define UC_CPU          0x04
 138 #define UC_MAU          0x08
 139 #define UC_XREGS        0x10
 140 #define UC_FPU          UC_MAU
 141 
 142 #define UC_MCONTEXT     (UC_CPU|UC_FPU)
 143 
 144 /*
 145  * UC_ALL specifies the default context
 146  */
 147 
 148 #define UC_ALL          (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
 149 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 150 
 151 #ifdef _KERNEL
 152 void savecontext(ucontext_t *, const k_sigset_t *);
 153 void restorecontext(ucontext_t *);
 154 
 155 #ifdef _SYSCALL32
 156 extern void savecontext32(ucontext32_t *, const k_sigset_t *);
 157 #endif
 158 #endif
 159