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/head/proc_service.h
          +++ new/usr/src/head/proc_service.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  #ifndef _PROC_SERVICE_H
  27   27  #define _PROC_SERVICE_H
  28   28  
  29   29  /*
  30   30   *  Description:
  31   31   *      Types, global variables, and function definitions for provider
  32   32   * of import functions for users of libc_db and librtld_db.
  33   33   */
  34   34  
  35   35  #ifdef __cplusplus
  36   36  extern "C" {
  37   37  #endif
  38   38  
  39   39  #include <sys/types.h>
  40   40  #include <sys/procfs_isa.h>
  41   41  #include <sys/lwp.h>
  42   42  #include <sys/auxv.h>
  43   43  #include <elf.h>
  44   44  #if defined(__i386) || defined(__amd64) /* for struct ssd */
  45   45  #include <sys/segments.h>
  46   46  #include <sys/sysi86.h>
  47   47  #endif
  48   48  
  
    | 
      ↓ open down ↓ | 
    48 lines elided | 
    
      ↑ open up ↑ | 
  
  49   49  
  50   50  typedef unsigned long   psaddr_t;
  51   51  
  52   52  typedef enum {
  53   53          PS_OK,          /* generic "call succeeded" */
  54   54          PS_ERR,         /* generic error */
  55   55          PS_BADPID,      /* bad process handle */
  56   56          PS_BADLID,      /* bad lwp identifier */
  57   57          PS_BADADDR,     /* bad address */
  58   58          PS_NOSYM,       /* p_lookup() could not find given symbol */
  59      -        PS_NOFREGS      /* FPU register set not available for given lwp */
       59 +        PS_NOFREGS,     /* FPU register set not available for given lwp */
       60 +        PS_NOXREGS      /* extended register set not available for given lwp */
  60   61  } ps_err_e;
  61   62  
  62   63  struct ps_prochandle;
  63   64  
  64   65  /*
  65   66   * See <sys/procfs_isa.h> for possible values of data_model.
  66   67   */
  67   68  extern ps_err_e ps_pdmodel(struct ps_prochandle *, int *data_model);
  68   69  
  69   70  /*
  70   71   * Special values for 'object_name' to refer to certain well-known objects.
  71   72   */
  72   73  #define PS_OBJ_EXEC     ((const char *)0x0)     /* the executable file */
  73   74  #define PS_OBJ_LDSO     ((const char *)0x1)     /* the dynamic linker */
  74   75  
  75   76  extern ps_err_e ps_pglobal_lookup(struct ps_prochandle *,
  76   77          const char *object_name, const char *sym_name, psaddr_t *sym_addr);
  77   78  
  78   79  #ifdef _LP64
  79   80  typedef Elf64_Sym       ps_sym_t;
  80   81  #else
  81   82  typedef Elf32_Sym       ps_sym_t;
  82   83  #endif
  83   84  extern ps_err_e ps_pglobal_sym(struct ps_prochandle *,
  84   85          const char *object_name, const char *sym_name, ps_sym_t *sym);
  85   86  
  86   87  /*
  87   88   * To read and write the process's address space.
  88   89   */
  89   90  extern ps_err_e ps_pread(struct ps_prochandle *,
  90   91                          psaddr_t, void *, size_t);
  91   92  extern ps_err_e ps_pwrite(struct ps_prochandle *,
  92   93                          psaddr_t, const void *, size_t);
  93   94  /*
  94   95   * The following four functions can be implemented as simple aliases for
  95   96   * the corresponding primary two functions above (#pragma weak ...).
  96   97   * They are artifacts of history that must be maintained.
  97   98   */
  98   99  extern ps_err_e ps_pdread(struct ps_prochandle *,
  99  100                          psaddr_t, void *, size_t);
 100  101  extern ps_err_e ps_pdwrite(struct ps_prochandle *,
 101  102                          psaddr_t, const void *, size_t);
 102  103  extern ps_err_e ps_ptread(struct ps_prochandle *,
 103  104                          psaddr_t, void *, size_t);
 104  105  extern ps_err_e ps_ptwrite(struct ps_prochandle *,
 105  106                          psaddr_t, const void *, size_t);
 106  107  
 107  108  extern ps_err_e ps_pstop(struct ps_prochandle *);
 108  109  extern ps_err_e ps_pcontinue(struct ps_prochandle *);
 109  110  extern ps_err_e ps_lstop(struct ps_prochandle *, lwpid_t);
 110  111  extern ps_err_e ps_lcontinue(struct ps_prochandle *, lwpid_t);
  
    | 
      ↓ open down ↓ | 
    41 lines elided | 
    
      ↑ open up ↑ | 
  
 111  112  
 112  113  extern ps_err_e ps_lgetregs(struct ps_prochandle *,
 113  114                          lwpid_t, prgregset_t);
 114  115  extern ps_err_e ps_lsetregs(struct ps_prochandle *,
 115  116                          lwpid_t, const prgregset_t);
 116  117  extern ps_err_e ps_lgetfpregs(struct ps_prochandle *,
 117  118                          lwpid_t, prfpregset_t *);
 118  119  extern ps_err_e ps_lsetfpregs(struct ps_prochandle *,
 119  120                          lwpid_t, const prfpregset_t *);
 120  121  
 121      -#if defined(__sparc) || defined(__sparcv9)
 122  122  extern ps_err_e ps_lgetxregsize(struct ps_prochandle *, lwpid_t, int *);
 123  123  extern ps_err_e ps_lgetxregs(struct ps_prochandle *, lwpid_t, caddr_t);
 124  124  extern ps_err_e ps_lsetxregs(struct ps_prochandle *, lwpid_t, caddr_t);
 125      -#endif
 126  125  
 127  126  #if defined(__i386) || defined(__amd64)
 128  127  extern ps_err_e ps_lgetLDT(struct ps_prochandle *, lwpid_t, struct ssd *);
 129  128  #endif
 130  129  
 131  130  extern ps_err_e ps_pauxv(struct ps_prochandle *, const auxv_t **);
 132  131  extern ps_err_e ps_pbrandname(struct ps_prochandle *, char *, size_t);
 133  132  
 134  133  extern ps_err_e ps_kill(struct ps_prochandle *, int sig);
 135  134  extern ps_err_e ps_lrolltoaddr(struct ps_prochandle *,
 136  135                          lwpid_t, psaddr_t go_addr, psaddr_t stop_addr);
 137  136  
 138  137  extern void     ps_plog(const char *fmt, ...);
 139  138  
 140  139  #ifdef __cplusplus
 141  140  }
 142  141  #endif
 143  142  
 144  143  #endif  /* _PROC_SERVICE_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX