Print this page
    
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
    usr/src/uts/common/fs/proc/prcontrol.c
    usr/src/uts/intel/os/archdep.c
    usr/src/uts/intel/sys/ucontext.h
    usr/src/uts/intel/syscall/getcontext.c
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man3proc/proc_service.3proc
          +++ new/usr/src/man/man3proc/proc_service.3proc
   1    1  '\" te
   2    2  .\" Copyright (c) 2007 by Sun Microsystems, Inc. All Rights Reserved.
   3    3  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4    4  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5    5  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6      -.TH PROC_SERVICE 3PROC "Oct 12, 2007"
        6 +.TH PROC_SERVICE 3PROC "Jan 23, 2023"
   7    7  .SH NAME
   8    8  proc_service \- process service interfaces
   9    9  .SH SYNOPSIS
  10      -.LP
  11   10  .nf
  12   11  #include <proc_service.h>
  13   12  
  14   13  \fBps_err_e\fR \fBps_pdmodel\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
  15   14       \fBint *\fR\fIdata_model\fR);
  16   15  .fi
  17   16  
  18   17  .LP
  19   18  .nf
  20   19  \fBps_err_e\fR \fBps_pglobal_lookup\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
  21   20       \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR,
  22   21       \fBpsaddr_t *\fR\fIsym_addr\fR);
  23   22  .fi
  24   23  
  25   24  .LP
  26   25  .nf
  27   26  \fBps_err_e\fR \fBps_pglobal_sym\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
  28   27       \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR,
  29   28       \fBps_sym_t *\fR\fIsym\fR);
  30   29  .fi
  31   30  
  32   31  .LP
  33   32  .nf
  34   33  \fBps_err_e\fR \fBps_pread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  35   34       \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  36   35  .fi
  37   36  
  38   37  .LP
  39   38  .nf
  40   39  \fBps_err_e\fR \fBps_pwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  41   40       \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  42   41  .fi
  43   42  
  44   43  .LP
  45   44  .nf
  46   45  \fBps_err_e\fR \fBps_pdread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  47   46       \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  48   47  .fi
  49   48  
  50   49  .LP
  51   50  .nf
  52   51  \fBps_err_e\fR \fBps_pdwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  53   52       \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  54   53  .fi
  55   54  
  56   55  .LP
  57   56  .nf
  58   57  \fBps_err_e\fR \fBps_ptread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  59   58       \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  60   59  .fi
  61   60  
  62   61  .LP
  63   62  .nf
  64   63  \fBps_err_e\fR \fBps_ptwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR,
  65   64       \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
  66   65  .fi
  67   66  
  68   67  .LP
  69   68  .nf
  70   69  \fBps_err_e\fR \fBps_pstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR);
  71   70  .fi
  72   71  
  73   72  .LP
  74   73  .nf
  75   74  \fBps_err_e\fR \fBps_pcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR);
  76   75  .fi
  77   76  
  78   77  .LP
  79   78  .nf
  80   79  \fBps_err_e\fR \fBps_lstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR);
  81   80  .fi
  82   81  
  83   82  .LP
  84   83  .nf
  85   84  \fBps_err_e\fR \fBps_lcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR);
  86   85  .fi
  87   86  
  88   87  .LP
  89   88  .nf
  90   89  \fBps_err_e\fR \fBps_lgetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR,
  91   90       \fBprgregset_t\fR \fIgregset\fR);
  92   91  .fi
  93   92  
  94   93  .LP
  95   94  .nf
  96   95  \fBps_err_e\fR \fBps_lsetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR,
  97   96       \fBconst prgregset_t\fR \fIgregset\fR);
  98   97  .fi
  99   98  
 100   99  .LP
 101  100  .nf
 102  101  \fBps_err_e\fR \fBps_lgetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR,
 103  102       \fBprfpregset_t *\fR\fIfpregset\fR);
 104  103  .fi
 105  104  
 106  105  .LP
 107  106  .nf
 108  107  \fBps_err_e\fR \fBps_lsetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR,
 109  108       \fBconst prfpregset_t *\fR\fIfpregset\fR);
 110  109  .fi
 111  110  
 112  111  .LP
 113  112  .nf
 114  113  \fBps_err_e\fR \fBps_pauxv\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
 115  114       \fBconst auxv_t **\fR\fIauxp\fR);
 116  115  .fi
 117  116  
 118  117  .LP
 119  118  .nf
 120  119  \fBps_err_e\fR \fBps_kill\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBint\fR \fIsig\fR);
 121  120  .fi
 122  121  
 123  122  .LP
  
    | 
      ↓ open down ↓ | 
    103 lines elided | 
    
      ↑ open up ↑ | 
  
 124  123  .nf
 125  124  \fBps_err_e\fR \fBps_lrolltoaddr\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
 126  125       \fBlwpid_t\fR \fIlwpid\fR, \fBpsaddr_t\fR \fIgo_addr\fR, \fBpsaddr_t\fR \fIstop_addr\fR);
 127  126  .fi
 128  127  
 129  128  .LP
 130  129  .nf
 131  130  \fBvoid\fR \fBps_plog\fR(\fBconst char *\fR\fIfmt\fR);
 132  131  .fi
 133  132  
 134      -.SS "SPARC"
 135  133  .LP
 136  134  .nf
 137  135  \fBps_err_e\fR \fBps_lgetxregsize\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
 138  136       \fBlwpid_t\fR \fIlwpid\fR, \fBint *\fR\fIxregsize\fR);
 139  137  .fi
 140  138  
 141  139  .LP
 142  140  .nf
 143  141  \fBps_err_e\fR \fBps_lgetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
 144  142       \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR);
 145  143  .fi
 146  144  
 147  145  .LP
 148  146  .nf
 149  147  \fBps_err_e\fR \fBps_lsetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR,
 150  148       \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR);
 151  149  .fi
 152  150  
 153  151  .SS "x86"
 154      -.LP
 155  152  .nf
 156  153  \fBps_err_e\fR \fBps_lgetLDT\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR,
 157  154       \fBstruct ssd *\fR\fIldt\fR);
 158  155  .fi
 159  156  
 160  157  .SH DESCRIPTION
 161      -.LP
 162  158  Every program that links \fBlibthread_db\fR or \fBlibrtld_db\fR must provide a
 163  159  set of process control primitives that allow \fBlibthread_db\fR and
 164  160  \fBlibrtld_db\fR to access memory and registers in the target process, to start
 165  161  and to stop the target process, and to look up symbols in the target process.
 166  162  See \fBlibc_db\fR(3LIB). For information on \fBlibrtld_db\fR, refer to the
 167  163  \fILinker and Libraries Guide\fR.
 168  164  .sp
 169  165  .LP
 170  166  Refer to the individual reference manual pages that describe these routines for
 171  167  a functional specification that clients of \fBlibthread_db\fR and
 172  168  \fBlibrtld_db\fR can use to implement this required interface. The
 173  169  <\fBproc_service.h\fR> header lists the C declarations of these routines.
 174  170  .SH FUNCTIONS
 175  171  .ne 2
 176  172  .na
 177  173  \fB\fBps_pdmodel()\fR\fR
 178  174  .ad
 179  175  .RS 23n
 180  176  Returns the data model of the target process.
 181  177  .RE
 182  178  
 183  179  .sp
 184  180  .ne 2
 185  181  .na
 186  182  \fB\fBps_pglobal_lookup()\fR\fR
 187  183  .ad
 188  184  .RS 23n
 189  185  Looks up the symbol in the symbol table of the load object in the target
 190  186  process and returns its address.
 191  187  .RE
 192  188  
 193  189  .sp
 194  190  .ne 2
 195  191  .na
 196  192  \fB\fBps_pglobal_sym()\fR\fR
 197  193  .ad
 198  194  .RS 23n
 199  195  Looks up the symbol in the symbol table of the load object in the target
 200  196  process and returns its symbol table entry.
 201  197  .RE
 202  198  
 203  199  .sp
 204  200  .ne 2
 205  201  .na
 206  202  \fB\fBps_pread()\fR\fR
 207  203  .ad
 208  204  .RS 23n
 209  205  Copies \fIsize\fR bytes from the target process to the controlling process.
 210  206  .RE
 211  207  
 212  208  .sp
 213  209  .ne 2
 214  210  .na
 215  211  \fB\fBps_pwrite()\fR\fR
 216  212  .ad
 217  213  .RS 23n
 218  214  Copies \fIsize\fR bytes from the controlling process to the target process.
 219  215  .RE
 220  216  
 221  217  .sp
 222  218  .ne 2
 223  219  .na
 224  220  \fB\fBps_pdread()\fR\fR
 225  221  .ad
 226  222  .RS 23n
 227  223  Identical to \fBps_pread()\fR.
 228  224  .RE
 229  225  
 230  226  .sp
 231  227  .ne 2
 232  228  .na
 233  229  \fB\fBps_pdwrite()\fR\fR
 234  230  .ad
 235  231  .RS 23n
 236  232  Identical to \fBps_pwrite()\fR.
 237  233  .RE
 238  234  
 239  235  .sp
 240  236  .ne 2
 241  237  .na
 242  238  \fB\fBps_ptread()\fR\fR
 243  239  .ad
 244  240  .RS 23n
 245  241  Identical to \fBps_pread()\fR.
 246  242  .RE
 247  243  
 248  244  .sp
 249  245  .ne 2
 250  246  .na
 251  247  \fB\fBps_ptwrite()\fR\fR
 252  248  .ad
 253  249  .RS 23n
 254  250  Identical to \fBps_pwrite()\fR.
 255  251  .RE
 256  252  
 257  253  .sp
 258  254  .ne 2
 259  255  .na
 260  256  \fB\fBps_pstop()\fR\fR
 261  257  .ad
 262  258  .RS 23n
 263  259  Stops the target process.
 264  260  .RE
 265  261  
 266  262  .sp
 267  263  .ne 2
 268  264  .na
 269  265  \fB\fBps_pcontinue()\fR\fR
 270  266  .ad
 271  267  .RS 23n
 272  268  Resumes target process.
 273  269  .RE
 274  270  
 275  271  .sp
 276  272  .ne 2
 277  273  .na
 278  274  \fB\fBps_lstop()\fR\fR
 279  275  .ad
 280  276  .RS 23n
 281  277  Stops a single lightweight process ( \fBLWP\fR ) within the target process.
 282  278  .RE
 283  279  
 284  280  .sp
 285  281  .ne 2
 286  282  .na
 287  283  \fB\fBps_lcontinue()\fR\fR
 288  284  .ad
 289  285  .RS 23n
 290  286  Resumes a single \fBLWP\fR within the target process.
 291  287  .RE
 292  288  
 293  289  .sp
 294  290  .ne 2
 295  291  .na
 296  292  \fB\fBps_lgetregs()\fR\fR
 297  293  .ad
 298  294  .RS 23n
 299  295  Gets the general registers of the \fBLWP\fR.
 300  296  .RE
 301  297  
 302  298  .sp
 303  299  .ne 2
 304  300  .na
 305  301  \fB\fBps_lsetregs()\fR\fR
 306  302  .ad
 307  303  .RS 23n
 308  304  Sets the general registers of the \fBLWP\fR.
 309  305  .RE
 310  306  
 311  307  .sp
 312  308  .ne 2
 313  309  .na
 314  310  \fB\fBps_lgetfpregs()\fR\fR
 315  311  .ad
 316  312  .RS 23n
 317  313  Gets the \fBLWP`s\fR floating point register set.
 318  314  .RE
 319  315  
 320  316  .sp
 321  317  .ne 2
 322  318  .na
 323  319  \fB\fBps_lsetfpregs()\fR\fR
 324  320  .ad
 325  321  .RS 23n
 326  322  Sets the \fBLWP`s\fR floating point register set.
 327  323  .RE
 328  324  
 329  325  .sp
 330  326  .ne 2
 331  327  .na
 332  328  \fB\fBps_pauxv()\fR\fR
 333  329  .ad
 334  330  .RS 23n
 335  331  Returns a pointer to a read-only copy of the auxiliary vector of the target
 336  332  process.
 337  333  .RE
 338  334  
 339  335  .sp
 340  336  .ne 2
 341  337  .na
 342  338  \fB\fBps_kill()\fR\fR
 343  339  .ad
 344  340  .RS 23n
 345  341  Sends signal to target process.
 346  342  .RE
 347  343  
 348  344  .sp
 349  345  .ne 2
 350  346  .na
 351  347  \fB\fBps_lrolltoaddr()\fR\fR
 352  348  .ad
 353  349  .RS 23n
 354  350  Rolls the \fBLWP\fR out of a critical section when the process is stopped.
 355  351  .RE
  
    | 
      ↓ open down ↓ | 
    184 lines elided | 
    
      ↑ open up ↑ | 
  
 356  352  
 357  353  .sp
 358  354  .ne 2
 359  355  .na
 360  356  \fB\fBps_plog()\fR\fR
 361  357  .ad
 362  358  .RS 23n
 363  359  Logs a message.
 364  360  .RE
 365  361  
 366      -.SS "SPARC"
 367  362  .ne 2
 368  363  .na
 369  364  \fB\fBps_lgetxregsize()\fR\fR
 370  365  .ad
 371  366  .RS 21n
 372  367  Returns the size of the architecture-dependent extra state registers.
 373  368  .RE
 374  369  
 375  370  .sp
 376  371  .ne 2
 377  372  .na
 378  373  \fB\fBps_lgetxregs()\fR\fR
 379  374  .ad
 380  375  .RS 21n
 381  376  Gets the extra state registers of the \fBLWP\fR.
 382  377  .RE
 383  378  
 384  379  .sp
 385  380  .ne 2
 386  381  .na
 387  382  \fB\fBps_lsetxregs()\fR\fR
 388  383  .ad
 389  384  .RS 21n
 390  385  Sets the extra state registers of the \fBLWP\fR.
 391  386  .RE
 392  387  
  
    | 
      ↓ open down ↓ | 
    16 lines elided | 
    
      ↑ open up ↑ | 
  
 393  388  .SS "x86"
 394  389  .ne 2
 395  390  .na
 396  391  \fB\fBps_lgetLDT()\fR\fR
 397  392  .ad
 398  393  .RS 16n
 399  394  Reads the local descriptor table of the \fBLWP\fR.
 400  395  .RE
 401  396  
 402  397  .SH ATTRIBUTES
 403      -.LP
 404  398  See \fBattributes\fR(7) for description of the following attributes:
 405  399  .sp
 406  400  
 407  401  .sp
 408  402  .TS
 409  403  box;
 410  404  c | c
 411  405  l | l .
 412  406  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 413  407  _
 414  408  MT Level        Safe
 415  409  .TE
 416  410  
 417  411  .SH SEE ALSO
 418      -.LP
 419  412  .BR rtld_db (3EXT),
 420  413  .BR libc_db (3LIB),
 421  414  .BR librtld_db (3LIB),
 422  415  .BR ps_pread (3PROC),
 423  416  .BR attributes (7)
 424  417  .sp
 425  418  .LP
 426  419  \fILinker and Libraries Guide\fR
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX