Print this page
XXX AVX procfs

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/syscall/getcontext.c
          +++ new/usr/src/uts/intel/ia32/syscall/getcontext.c
↓ open down ↓ 176 lines elided ↑ open up ↑
 177  177  }
 178  178  
 179  179  
 180  180  int
 181  181  getsetcontext(int flag, void *arg)
 182  182  {
 183  183          ucontext_t uc;
 184  184          ucontext_t *ucp;
 185  185          klwp_t *lwp = ttolwp(curthread);
 186  186          stack_t dummy_stk;
      187 +        caddr_t xregs = NULL;
      188 +        int xregs_size = 0;
 187  189  
 188  190          /*
 189  191           * In future releases, when the ucontext structure grows,
 190  192           * getcontext should be modified to only return the fields
 191  193           * specified in the uc_flags.  That way, the structure can grow
 192  194           * and still be binary compatible will all .o's which will only
 193  195           * have old fields defined in uc_flags
 194  196           */
 195  197  
 196  198          switch (flag) {
↓ open down ↓ 24 lines elided ↑ open up ↑
 221  223                  }
 222  224                  if (uc.uc_flags & UC_SIGMASK)
 223  225                          SIGSET_BRAND_TO_NATIVE(&uc.uc_sigmask);
 224  226  
 225  227                  if ((uc.uc_flags & UC_FPU) &&
 226  228                      copyin(&ucp->uc_mcontext.fpregs, &uc.uc_mcontext.fpregs,
 227  229                      sizeof (uc.uc_mcontext.fpregs))) {
 228  230                          return (set_errno(EFAULT));
 229  231                  }
 230  232  
      233 +                /*
      234 +                 * Get extra register state.
      235 +                 */
      236 +                xregs_clrptr(lwp, &uc);
      237 +
 231  238                  restorecontext(&uc);
 232  239  
 233  240                  if ((uc.uc_flags & UC_STACK) && (lwp->lwp_ustack != 0))
 234  241                          (void) copyout(&uc.uc_stack, (stack_t *)lwp->lwp_ustack,
 235  242                              sizeof (uc.uc_stack));
      243 +
      244 +                /*
      245 +                 * Free extra register state.
      246 +                 */
      247 +                if (xregs_size)
      248 +                        kmem_free(xregs, xregs_size);
      249 +
 236  250                  return (0);
 237  251  
 238  252          case GETUSTACK:
 239  253                  if (copyout(&lwp->lwp_ustack, arg, sizeof (caddr_t)))
 240  254                          return (set_errno(EFAULT));
 241  255                  return (0);
 242  256  
 243  257          case SETUSTACK:
 244  258                  if (copyin(arg, &dummy_stk, sizeof (dummy_stk)))
 245  259                          return (set_errno(EFAULT));
↓ open down ↓ 134 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX