1432         args_addr = uc_addr - SA(6 * sizeof (uintptr_t));
1433 
1434         watched = watch_disable_addr((caddr_t)sp, frsz, S_WRITE);
1435 
1436         /*
1437          * Save the register state we preserved on the way into this brand
1438          * system call and drop it on the native stack.
1439          */
1440         {
1441                 /*
1442                  * Note: the amd64 ucontext_t is 864 bytes.
1443                  */
1444                 ucontext_t uc;
1445 
1446                 /*
1447                  * We do not want to save the signal mask for an emulation
1448                  * context.  Some emulated system calls alter the signal mask;
1449                  * restoring it when the emulation is complete would clobber
1450                  * those intentional side effects.
1451                  */
1452                 savecontext(&uc, NULL);
1453 
1454                 if (on_fault(&lab)) {
1455                         goto badstack;
1456                 }
1457 
1458                 /*
1459                  * Mark this as a system call emulation context:
1460                  */
1461                 uc.uc_brand_data[0] = (void *)((uintptr_t)
1462                     uc.uc_brand_data[0] | LX_UC_FRAME_IS_SYSCALL);
1463 
1464                 copyout_noerr(&uc, (void *)(uintptr_t)uc_addr, sizeof (uc));
1465         }
1466 
1467         DTRACE_PROBE3(oldcontext__set, klwp_t *, lwp,
1468             uintptr_t, lwp->lwp_oldcontext, uintptr_t, uc_addr);
1469         lwp->lwp_oldcontext = (uintptr_t)uc_addr;
1470 
1471         /*
1472          * Copy the system call arguments out to userland:
 
1600         args_addr = uc_addr - SA32(6 * sizeof (uint32_t));
1601 
1602         watched = watch_disable_addr((caddr_t)(uintptr_t)sp, frsz, S_WRITE);
1603 
1604         /*
1605          * Save the register state we preserved on the way into this brand
1606          * system call and drop it on the native stack.
1607          */
1608         {
1609                 /*
1610                  * Note: ucontext32_t is 512 bytes.
1611                  */
1612                 ucontext32_t uc;
1613 
1614                 /*
1615                  * We do not want to save the signal mask for an emulation
1616                  * context.  Some emulated system calls alter the signal mask;
1617                  * restoring it when the emulation is complete would clobber
1618                  * those intentional side effects.
1619                  */
1620                 savecontext32(&uc, NULL);
1621 
1622                 if (on_fault(&lab)) {
1623                         goto badstack;
1624                 }
1625 
1626                 /*
1627                  * Mark this as a system call emulation context:
1628                  */
1629                 uc.uc_brand_data[0] |= LX_UC_FRAME_IS_SYSCALL;
1630                 copyout_noerr(&uc, (void *)(uintptr_t)uc_addr, sizeof (uc));
1631         }
1632 
1633         DTRACE_PROBE3(oldcontext__set, klwp_t *, lwp,
1634             uintptr_t, lwp->lwp_oldcontext, uintptr_t, uc_addr);
1635         lwp->lwp_oldcontext = (uintptr_t)uc_addr;
1636 
1637         /*
1638          * Copy the system call arguments out to userland:
1639          */
1640         {
 
 | 
 
 
1432         args_addr = uc_addr - SA(6 * sizeof (uintptr_t));
1433 
1434         watched = watch_disable_addr((caddr_t)sp, frsz, S_WRITE);
1435 
1436         /*
1437          * Save the register state we preserved on the way into this brand
1438          * system call and drop it on the native stack.
1439          */
1440         {
1441                 /*
1442                  * Note: the amd64 ucontext_t is 864 bytes.
1443                  */
1444                 ucontext_t uc;
1445 
1446                 /*
1447                  * We do not want to save the signal mask for an emulation
1448                  * context.  Some emulated system calls alter the signal mask;
1449                  * restoring it when the emulation is complete would clobber
1450                  * those intentional side effects.
1451                  */
1452                 /* XXX KEBE ASKS PLUMB UP EXTENDED?!? */
1453                 savecontext(&uc, NULL, 0);
1454 
1455                 if (on_fault(&lab)) {
1456                         goto badstack;
1457                 }
1458 
1459                 /*
1460                  * Mark this as a system call emulation context:
1461                  */
1462                 uc.uc_brand_data[0] = (void *)((uintptr_t)
1463                     uc.uc_brand_data[0] | LX_UC_FRAME_IS_SYSCALL);
1464 
1465                 copyout_noerr(&uc, (void *)(uintptr_t)uc_addr, sizeof (uc));
1466         }
1467 
1468         DTRACE_PROBE3(oldcontext__set, klwp_t *, lwp,
1469             uintptr_t, lwp->lwp_oldcontext, uintptr_t, uc_addr);
1470         lwp->lwp_oldcontext = (uintptr_t)uc_addr;
1471 
1472         /*
1473          * Copy the system call arguments out to userland:
 
1601         args_addr = uc_addr - SA32(6 * sizeof (uint32_t));
1602 
1603         watched = watch_disable_addr((caddr_t)(uintptr_t)sp, frsz, S_WRITE);
1604 
1605         /*
1606          * Save the register state we preserved on the way into this brand
1607          * system call and drop it on the native stack.
1608          */
1609         {
1610                 /*
1611                  * Note: ucontext32_t is 512 bytes.
1612                  */
1613                 ucontext32_t uc;
1614 
1615                 /*
1616                  * We do not want to save the signal mask for an emulation
1617                  * context.  Some emulated system calls alter the signal mask;
1618                  * restoring it when the emulation is complete would clobber
1619                  * those intentional side effects.
1620                  */
1621                 /* XXX KEBE ASKS PLUMB UP EXTENDED?!? */
1622                 savecontext32(&uc, NULL, 0);
1623 
1624                 if (on_fault(&lab)) {
1625                         goto badstack;
1626                 }
1627 
1628                 /*
1629                  * Mark this as a system call emulation context:
1630                  */
1631                 uc.uc_brand_data[0] |= LX_UC_FRAME_IS_SYSCALL;
1632                 copyout_noerr(&uc, (void *)(uintptr_t)uc_addr, sizeof (uc));
1633         }
1634 
1635         DTRACE_PROBE3(oldcontext__set, klwp_t *, lwp,
1636             uintptr_t, lwp->lwp_oldcontext, uintptr_t, uc_addr);
1637         lwp->lwp_oldcontext = (uintptr_t)uc_addr;
1638 
1639         /*
1640          * Copy the system call arguments out to userland:
1641          */
1642         {
 
 |