Print this page
XXX AVX procfs

@@ -182,10 +182,12 @@
 {
         ucontext_t uc;
         ucontext_t *ucp;
         klwp_t *lwp = ttolwp(curthread);
         stack_t dummy_stk;
+        caddr_t xregs = NULL;
+        int xregs_size = 0;
 
         /*
          * In future releases, when the ucontext structure grows,
          * getcontext should be modified to only return the fields
          * specified in the uc_flags.  That way, the structure can grow

@@ -226,15 +228,27 @@
                     copyin(&ucp->uc_mcontext.fpregs, &uc.uc_mcontext.fpregs,
                     sizeof (uc.uc_mcontext.fpregs))) {
                         return (set_errno(EFAULT));
                 }
 
+                /*
+                 * Get extra register state.
+                 */
+                xregs_clrptr(lwp, &uc);
+
                 restorecontext(&uc);
 
                 if ((uc.uc_flags & UC_STACK) && (lwp->lwp_ustack != 0))
                         (void) copyout(&uc.uc_stack, (stack_t *)lwp->lwp_ustack,
                             sizeof (uc.uc_stack));
+
+                /*
+                 * Free extra register state.
+                 */
+                if (xregs_size)
+                        kmem_free(xregs, xregs_size);
+
                 return (0);
 
         case GETUSTACK:
                 if (copyout(&lwp->lwp_ustack, arg, sizeof (caddr_t)))
                         return (set_errno(EFAULT));