Print this page
XXX AVX procfs

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/proc/prcontrol.c
          +++ new/usr/src/uts/common/fs/proc/prcontrol.c
↓ open down ↓ 51 lines elided ↑ open up ↑
  52   52  #include <sys/zone.h>
  53   53  #include <sys/copyops.h>
  54   54  #include <sys/schedctl.h>
  55   55  #include <vm/as.h>
  56   56  #include <vm/seg.h>
  57   57  #include <fs/proc/prdata.h>
  58   58  #include <sys/contract/process_impl.h>
  59   59  
  60   60  static  void    pr_settrace(proc_t *, sigset_t *);
  61   61  static  int     pr_setfpregs(prnode_t *, prfpregset_t *);
  62      -#if defined(__sparc)
  63   62  static  int     pr_setxregs(prnode_t *, prxregset_t *);
       63 +#if defined(__sparc)
  64   64  static  int     pr_setasrs(prnode_t *, asrset_t);
  65   65  #endif
  66   66  static  int     pr_setvaddr(prnode_t *, caddr_t);
  67   67  static  int     pr_clearsig(prnode_t *);
  68   68  static  int     pr_clearflt(prnode_t *);
  69   69  static  int     pr_watch(prnode_t *, prwatch_t *, int *);
  70   70  static  int     pr_agent(prnode_t *, prgregset_t, int *);
  71   71  static  int     pr_rdwr(proc_t *, enum uio_rw, priovec_t *);
  72   72  static  int     pr_scred(proc_t *, prcred_t *, cred_t *, boolean_t);
  73   73  static  int     pr_spriv(proc_t *, prpriv_t *, cred_t *);
↓ open down ↓ 6 lines elided ↑ open up ↑
  80   80          long            nice;           /* PCNICE */
  81   81          long            timeo;          /* PCTWSTOP */
  82   82          ulong_t         flags;          /* PCRUN, PCSET, PCUNSET */
  83   83          caddr_t         vaddr;          /* PCSVADDR */
  84   84          siginfo_t       siginfo;        /* PCSSIG */
  85   85          sigset_t        sigset;         /* PCSTRACE, PCSHOLD */
  86   86          fltset_t        fltset;         /* PCSFAULT */
  87   87          sysset_t        sysset;         /* PCSENTRY, PCSEXIT */
  88   88          prgregset_t     prgregset;      /* PCSREG, PCAGENT */
  89   89          prfpregset_t    prfpregset;     /* PCSFPREG */
  90      -#if defined(__sparc)
  91   90          prxregset_t     prxregset;      /* PCSXREG */
       91 +#if defined(__sparc)
  92   92          asrset_t        asrset;         /* PCSASRS */
  93   93  #endif
  94   94          prwatch_t       prwatch;        /* PCWATCH */
  95   95          priovec_t       priovec;        /* PCREAD, PCWRITE */
  96   96          prcred_t        prcred;         /* PCSCRED */
  97   97          prpriv_t        prpriv;         /* PCSPRIV */
  98   98          long            przoneid;       /* PCSZONE */
  99   99  } arg_t;
 100  100  
 101  101  static  int     pr_control(long, arg_t *, prnode_t *, cred_t *);
↓ open down ↓ 43 lines elided ↑ open up ↑
 145  145          case PCSEXIT:
 146  146                  size += sizeof (sysset_t);
 147  147                  break;
 148  148          case PCSREG:
 149  149          case PCAGENT:
 150  150                  size += sizeof (prgregset_t);
 151  151                  break;
 152  152          case PCSFPREG:
 153  153                  size += sizeof (prfpregset_t);
 154  154                  break;
 155      -#if defined(__sparc)
 156  155          case PCSXREG:
 157  156                  size += sizeof (prxregset_t);
 158  157                  break;
      158 +#if defined(__sparc)
 159  159          case PCSASRS:
 160  160                  size += sizeof (asrset_t);
 161  161                  break;
 162  162  #endif
 163  163          case PCWATCH:
 164  164                  size += sizeof (prwatch_t);
 165  165                  break;
 166  166          case PCREAD:
 167  167          case PCWRITE:
 168  168                  size += sizeof (priovec_t);
↓ open down ↓ 242 lines elided ↑ open up ↑
 411  411                                  mutex_enter(&p->p_lock);
 412  412                          }
 413  413                          break;
 414  414                  }
 415  415  
 416  416          case PCSFPREG:  /* set floating-point registers */
 417  417                  error = pr_setfpregs(pnp, &argp->prfpregset);
 418  418                  break;
 419  419  
 420  420          case PCSXREG:   /* set extra registers */
 421      -#if defined(__sparc)
 422  421                  error = pr_setxregs(pnp, &argp->prxregset);
 423      -#else
 424      -                error = EINVAL;
 425      -#endif
 426  422                  break;
 427  423  
 428  424  #if defined(__sparc)
 429  425          case PCSASRS:   /* set ancillary state registers */
 430  426                  error = pr_setasrs(pnp, argp->asrset);
 431  427                  break;
 432  428  #endif
 433  429  
 434  430          case PCSVADDR:  /* set virtual address at which to resume */
 435  431                  error = pr_setvaddr(pnp, argp->vaddr);
↓ open down ↓ 60 lines elided ↑ open up ↑
 496  492          int32_t         nice;           /* PCNICE */
 497  493          int32_t         timeo;          /* PCTWSTOP */
 498  494          uint32_t        flags;          /* PCRUN, PCSET, PCUNSET */
 499  495          caddr32_t       vaddr;          /* PCSVADDR */
 500  496          siginfo32_t     siginfo;        /* PCSSIG */
 501  497          sigset_t        sigset;         /* PCSTRACE, PCSHOLD */
 502  498          fltset_t        fltset;         /* PCSFAULT */
 503  499          sysset_t        sysset;         /* PCSENTRY, PCSEXIT */
 504  500          prgregset32_t   prgregset;      /* PCSREG, PCAGENT */
 505  501          prfpregset32_t  prfpregset;     /* PCSFPREG */
 506      -#if defined(__sparc)
 507  502          prxregset_t     prxregset;      /* PCSXREG */
 508      -#endif
 509  503          prwatch32_t     prwatch;        /* PCWATCH */
 510  504          priovec32_t     priovec;        /* PCREAD, PCWRITE */
 511  505          prcred32_t      prcred;         /* PCSCRED */
 512  506          prpriv_t        prpriv;         /* PCSPRIV */
 513  507          int32_t         przoneid;       /* PCSZONE */
 514  508  } arg32_t;
 515  509  
 516  510  static  int     pr_control32(int32_t, arg32_t *, prnode_t *, cred_t *);
 517  511  static  int     pr_setfpregs32(prnode_t *, prfpregset32_t *);
 518  512  
↓ open down ↓ 47 lines elided ↑ open up ↑
 566  560          case PCSEXIT:
 567  561                  size += sizeof (sysset_t);
 568  562                  break;
 569  563          case PCSREG:
 570  564          case PCAGENT:
 571  565                  size += sizeof (prgregset32_t);
 572  566                  break;
 573  567          case PCSFPREG:
 574  568                  size += sizeof (prfpregset32_t);
 575  569                  break;
 576      -#if defined(__sparc)
 577  570          case PCSXREG:
 578  571                  size += sizeof (prxregset_t);
 579  572                  break;
 580      -#endif
 581  573          case PCWATCH:
 582  574                  size += sizeof (prwatch32_t);
 583  575                  break;
 584  576          case PCREAD:
 585  577          case PCWRITE:
 586  578                  size += sizeof (priovec32_t);
 587  579                  break;
 588  580          case PCSCRED:
 589  581                  size += sizeof (prcred32_t);
 590  582                  break;
↓ open down ↓ 268 lines elided ↑ open up ↑
 859  851                  break;
 860  852  
 861  853          case PCSFPREG:  /* set floating-point registers */
 862  854                  if (PROCESS_NOT_32BIT(p))
 863  855                          error = EOVERFLOW;
 864  856                  else
 865  857                          error = pr_setfpregs32(pnp, &argp->prfpregset);
 866  858                  break;
 867  859  
 868  860          case PCSXREG:   /* set extra registers */
 869      -#if defined(__sparc)
 870  861                  if (PROCESS_NOT_32BIT(p))
 871  862                          error = EOVERFLOW;
 872  863                  else
 873  864                          error = pr_setxregs(pnp, &argp->prxregset);
 874      -#else
 875      -                error = EINVAL;
 876      -#endif
 877  865                  break;
 878  866  
 879  867          case PCSVADDR:  /* set virtual address at which to resume */
 880  868                  if (PROCESS_NOT_32BIT(p))
 881  869                          error = EOVERFLOW;
 882  870                  else
 883  871                          error = pr_setvaddr(pnp,
 884  872                              (caddr_t)(uintptr_t)argp->vaddr);
 885  873                  break;
 886  874  
↓ open down ↓ 812 lines elided ↑ open up ↑
1699 1687          /* drop p_lock while touching the lwp's stack */
1700 1688          thread_unlock(t);
1701 1689          mutex_exit(&p->p_lock);
1702 1690          prsetprfpregs32(ttolwp(t), prfpregset);
1703 1691          mutex_enter(&p->p_lock);
1704 1692  
1705 1693          return (0);
1706 1694  }
1707 1695  #endif  /* _SYSCALL32_IMPL */
1708 1696  
1709      -#if defined(__sparc)
1710 1697  /* ARGSUSED */
1711 1698  static int
1712 1699  pr_setxregs(prnode_t *pnp, prxregset_t *prxregset)
1713 1700  {
1714 1701          proc_t *p = pnp->pr_common->prc_proc;
1715 1702          kthread_t *t = pr_thread(pnp);  /* returns locked thread */
1716 1703  
1717 1704          if (!ISTOPPED(t) && !VSTOPPED(t) && !DSTOPPED(t)) {
1718 1705                  thread_unlock(t);
1719 1706                  return (EBUSY);
↓ open down ↓ 4 lines elided ↑ open up ↑
1724 1711                  return (EINVAL);        /* No extra register support */
1725 1712  
1726 1713          /* drop p_lock while touching the lwp's stack */
1727 1714          mutex_exit(&p->p_lock);
1728 1715          prsetprxregs(ttolwp(t), (caddr_t)prxregset);
1729 1716          mutex_enter(&p->p_lock);
1730 1717  
1731 1718          return (0);
1732 1719  }
1733 1720  
     1721 +#if defined(__sparc)
1734 1722  static int
1735 1723  pr_setasrs(prnode_t *pnp, asrset_t asrset)
1736 1724  {
1737 1725          proc_t *p = pnp->pr_common->prc_proc;
1738 1726          kthread_t *t = pr_thread(pnp);  /* returns locked thread */
1739 1727  
1740 1728          if (!ISTOPPED(t) && !VSTOPPED(t) && !DSTOPPED(t)) {
1741 1729                  thread_unlock(t);
1742 1730                  return (EBUSY);
1743 1731          }
↓ open down ↓ 780 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX