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/lib/libc/inc/libc.h
          +++ new/usr/src/lib/libc/inc/libc.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  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28   28   * This is where all the interfaces that are internal to libc
  29   29   * which do not have a better home live
  30   30   */
  31   31  
  32   32  #ifndef _LIBC_H
  33   33  #define _LIBC_H
  34   34  
  35   35  #include <thread.h>
  36   36  #include <stdio.h>
  37   37  #include <dirent.h>
  38   38  #include <ucontext.h>
  39   39  #include <nsswitch.h>
  40   40  #include <stddef.h>
  41   41  #include <poll.h>
  42   42  #include <sys/dl.h>
  43   43  #include <sys/door.h>
  44   44  #include <sys/ieeefp.h>
  45   45  #include <sys/mount.h>
  46   46  #include <floatingpoint.h>
  47   47  #include <nl_types.h>
  48   48  #include <regex.h>
  49   49  #include <stdarg.h>
  50   50  #include <wchar.h>
  51   51  #include <wctype.h>
  52   52  #include <libnvpair.h>
  53   53  #include <setjmp.h>
  54   54  
  55   55  #ifdef  __cplusplus
  56   56  extern "C" {
  57   57  #endif
  58   58  
  59   59  extern void __set_panicstr(const char *);
  60   60  extern void _rewind_unlocked(FILE *);
  61   61  extern long _sysconfig(int);
  62   62  extern int kill(pid_t pid, int sig);
  63   63  
  64   64  extern int primary_link_map;
  65   65  extern void _thr_exit(void *) __NORETURN;
  66   66  extern int thr_main(void);
  67   67  extern int thr_kill(thread_t tid, int sig);
  68   68  extern thread_t thr_self(void);
  69   69  extern int mutex_lock(mutex_t *mp);
  70   70  extern int mutex_unlock(mutex_t *mp);
  71   71  extern void callout_lock_enter(void);
  72   72  extern void callout_lock_exit(void);
  73   73  extern void *lmalloc(size_t);
  74   74  extern void lfree(void *, size_t);
  75   75  extern void libc_nvlist_free(nvlist_t *);
  76   76  extern int libc_nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *);
  77   77  extern void *libc_malloc(size_t);
  78   78  extern void *libc_realloc(void *, size_t);
  79   79  extern void libc_free(void *);
  80   80  extern char *libc_strdup(const char *);
  81   81  extern int _pollsys(struct pollfd *, nfds_t, const timespec_t *,
  82   82          const sigset_t *);
  83   83  
  84   84  /*
  85   85   * The private_DIR structure is the same as the DIR structure,
  86   86   * with the addition of a mutex lock for libc's internal use.
  87   87   */
  88   88  typedef struct {
  89   89          DIR     dd_dir;
  90   90          mutex_t dd_lock;
  91   91  } private_DIR;
  92   92  
  93   93  #if !defined(_LP64)
  94   94  /*
  95   95   * getdents64 transitional interface is intentionally internal to libc
  96   96   */
  97   97  extern int getdents64(int, struct dirent64 *, size_t);
  98   98  #endif
  99   99  
 100  100  extern int _scrwidth(wchar_t);
 101  101  
 102  102  extern int64_t __div64(int64_t, int64_t);
 103  103  extern int64_t __rem64(int64_t, int64_t);
 104  104  extern uint64_t __udiv64(uint64_t, uint64_t);
 105  105  extern uint64_t __urem64(uint64_t, uint64_t);
 106  106  extern int64_t __mul64(int64_t, int64_t);
 107  107  extern uint64_t __umul64(uint64_t, uint64_t);
 108  108  
 109  109  
 110  110  /*
 111  111   * Rounding direction functions
 112  112   */
 113  113  #if defined(__i386) || defined(__amd64)
 114  114  extern enum fp_direction_type __xgetRD(void);
 115  115  #elif defined(__sparc)
 116  116  extern enum fp_direction_type _QgetRD(void);
 117  117  #else
 118  118  #error Unknown architecture!
 119  119  #endif
 120  120  
 121  121  /*
 122  122   * defined in open.c
 123  123   */
 124  124  extern  int     __open(const char *, int, mode_t);
 125  125  extern  int     __open64(const char *, int, mode_t);
 126  126  extern  int     __openat(int, const char *, int, mode_t);
 127  127  extern  int     __openat64(int, const char *, int, mode_t);
 128  128  
 129  129  /*
 130  130   * defined in hex_bin.c
 131  131   */
 132  132  extern void __hex_to_single(decimal_record *, enum fp_direction_type,
 133  133          single *, fp_exception_field_type *);
 134  134  extern void __hex_to_double(decimal_record *, enum fp_direction_type,
 135  135          double *, fp_exception_field_type *);
 136  136  #if defined(__sparc)
 137  137  extern void __hex_to_quadruple(decimal_record *, enum fp_direction_type,
 138  138          quadruple *, fp_exception_field_type *);
 139  139  #elif defined(__i386) || defined(__amd64)
 140  140  extern void __hex_to_extended(decimal_record *, enum fp_direction_type,
 141  141          extended *, fp_exception_field_type *);
 142  142  #else
 143  143  #error Unknown architecture
 144  144  #endif
 145  145  
 146  146  /*
 147  147   * defined in ctime.c
 148  148   */
 149  149  extern char     *__posix_asctime_r(const struct tm *, char *);
 150  150  
 151  151  /*
 152  152   * Internal routine from fsync.c
 153  153   */
 154  154  extern int __fdsync(int, int);  /* 2nd arg may be wrong in 64bit mode */
 155  155  
 156  156  /*
 157  157   * Internal routine from _xregs_clrptr.c
 158  158   */
 159  159  extern void _xregs_clrptr(ucontext_t *);
 160  160  
 161  161  /*
 162  162   * Internal routine from nfssys.c
 163  163   */
 164  164  extern int _nfssys(int, void *); /* int in 64bit mode ???, void * ??? */
 165  165  
 166  166  /*
 167  167   * Internal routine from psetsys.c
 168  168   */
 169  169  extern int _pset(int, ...); /* int in 64bit mode ??? */
 170  170  
 171  171  /*
 172  172   * defined in sigpending.s
 173  173   */
 174  174  extern int __sigfillset(sigset_t *);
 175  175  
 176  176  /*
 177  177   * defined in sparc/fp/_Q_set_except.c and i386/fp/exception.c
 178  178   */
 179  179  extern int _Q_set_exception(unsigned int);
 180  180  
 181  181  /*
 182  182   * defined in nsparse.c
 183  183   */
 184  184  extern struct __nsw_switchconfig *_nsw_getoneconfig(const char *name,
 185  185          char *linep, enum __nsw_parse_err *);
 186  186  extern struct __nsw_switchconfig_v1 *_nsw_getoneconfig_v1(const char *name,
 187  187          char *linep, enum __nsw_parse_err *);
 188  188  
 189  189  /*
 190  190   * Internal routine from getusershell.c
 191  191   */
 192  192  extern char *getusershell(void);
 193  193  
 194  194  /*
 195  195   * defined in _sigaction.s
 196  196   */
 197  197  extern int __sigaction(int, const struct sigaction *, struct sigaction *);
 198  198  
 199  199  /*
 200  200   * defined in siglongjmp.c
 201  201   */
 202  202  extern void _siglongjmp(sigjmp_buf, int) __NORETURN;
 203  203  
 204  204  /*
 205  205   * defined in _getsp.s
 206  206   */
 207  207  extern greg_t _getsp(void);
 208  208  
 209  209  /*
 210  210   * defined in _so_setsockopt.s
 211  211   */
 212  212  extern int _so_setsockopt(int, int, int, const char *, int);
 213  213  
 214  214  /*
 215  215   * defined in _so_getsockopt.s
 216  216   */
 217  217  extern int _so_getsockopt(int, int, int, char *, int *);
 218  218  
 219  219  /*
 220  220   * defined in lsign.s
 221  221   */
 222  222  extern int lsign(dl_t);
  
    | 
      ↓ open down ↓ | 
    222 lines elided | 
    
      ↑ open up ↑ | 
  
 223  223  
 224  224  /*
 225  225   * defined in getctxt.c
 226  226   */
 227  227  extern int _getcontext(ucontext_t *) __RETURNS_TWICE;
 228  228  
 229  229  /*
 230  230   * defined in ucontext.s
 231  231   */
 232  232  extern int __getcontext(ucontext_t *);
      233 +extern int __getcontext_extd(ucontext_t *);
 233  234  
 234  235  /*
 235  236   * defined in door.s
 236  237   */
 237  238  extern int __door_info(int, door_info_t *);
 238  239  extern int __door_call(int, door_arg_t *);
 239  240  
 240  241  /*
 241  242   * defined in _portfs.s
 242  243   */
 243  244  extern int64_t _portfs(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t,
 244  245      uintptr_t);
 245  246  
 246  247  /*
 247  248   * defined in xpg4.c
 248  249   */
 249  250  extern int __xpg4;              /* global */
 250  251  extern int libc__xpg4;          /* copy of __xpg4, private to libc */
 251  252  
 252  253  /*
 253  254   * defined in xpg6.c
 254  255   */
 255  256  extern uint_t __xpg6;           /* global */
 256  257  extern uint_t libc__xpg6;       /* copy of __xpg6, private to libc */
 257  258  
 258  259  /*
 259  260   * defined in port/stdio/doscan.c
 260  261   */
 261  262  extern int _doscan(FILE *, const char *, va_list);
 262  263  extern int __doscan_u(FILE *, const char *, va_list, int);
 263  264  extern int __wdoscan_u(FILE *, const wchar_t *, va_list, int);
 264  265  
 265  266  #ifndef _LP64
 266  267  /* Flag for _ndoprnt() and _doscan_u() */
 267  268  #define _F_INTMAX32     0x1     /* if set read 4 bytes for u/intmax %j */
 268  269  extern int _fprintf_c89(FILE *, const char *, ...);
 269  270  extern int _printf_c89(const char *, ...);
 270  271  extern int _snprintf_c89(char *, size_t, const char *, ...);
 271  272  extern int _sprintf_c89(char *, const char *, ...);
 272  273  extern int _wprintf_c89(const wchar_t *, ...);
 273  274  extern int _fwprintf_c89(FILE *, const wchar_t *, ...);
 274  275  extern int _swprintf_c89(wchar_t *, size_t, const wchar_t *, ...);
 275  276  extern int _vfprintf_c89(FILE *, const char *, va_list);
 276  277  extern int _vprintf_c89(const char *, va_list);
 277  278  extern int _vsnprintf_c89(char *, size_t, const char *, va_list);
 278  279  extern int _vsprintf_c89(char *, const char *, va_list);
 279  280  extern int _vwprintf_c89(const wchar_t *, va_list);
 280  281  extern int _vfwprintf_c89(FILE *, const wchar_t *, va_list);
 281  282  extern int _vswprintf_c89(wchar_t *, size_t, const wchar_t *, va_list);
 282  283  extern int _scanf_c89(const char *, ...);
 283  284  extern int _fscanf_c89(FILE *, const char *, ...);
 284  285  extern int _sscanf_c89(const char *, const char *, ...);
 285  286  extern int _vscanf_c89(const char *, va_list);
 286  287  extern int _vfscanf_c89(FILE *, const char *, va_list);
 287  288  extern int _vsscanf_c89(const char *, const char *, va_list);
 288  289  extern int _vwscanf_c89(const wchar_t *, va_list);
 289  290  extern int _vfwscanf_c89(FILE *, const wchar_t *, va_list);
 290  291  extern int _vswscanf_c89(const wchar_t *, const wchar_t *, va_list);
 291  292  extern int _wscanf_c89(const wchar_t *, ...);
 292  293  extern int _fwscanf_c89(FILE *, const wchar_t *, ...);
 293  294  extern int _swscanf_c89(const wchar_t *, const wchar_t *, ...);
 294  295  #endif  /*      _LP64   */
 295  296  
 296  297  /*
 297  298   * defined in port/stdio/popen.c
 298  299   */
 299  300  extern int _insert(pid_t pid, int fd);
 300  301  extern pid_t _delete(int fd);
 301  302  
 302  303  /*
 303  304   * defined in port/print/doprnt.c
 304  305   */
 305  306  extern ssize_t  _wdoprnt(const wchar_t *, va_list, FILE *);
 306  307  
 307  308  /*
 308  309   * defined in fgetwc.c
 309  310   */
 310  311  extern wint_t _fgetwc_unlocked(FILE *);
 311  312  extern wint_t __getwc_xpg5(FILE *);
 312  313  extern wint_t __fgetwc_xpg5(FILE *);
 313  314  extern wint_t _getwc(FILE *);
 314  315  
 315  316  /*
 316  317   * defined in fputwc.c
 317  318   */
 318  319  extern wint_t __putwc_xpg5(wint_t, FILE *);
 319  320  extern wint_t _putwc(wint_t, FILE *);
 320  321  
 321  322  /*
 322  323   * defined in ungetwc.c
 323  324   */
 324  325  extern wint_t   __ungetwc_xpg5(wint_t, FILE *);
 325  326  
 326  327  /*
 327  328   * Defined in setlocale.c.
 328  329   */
 329  330  extern char *current_locale(locale_t, int);
 330  331  
 331  332  /*
 332  333   * defined in set_constraint_handler_s.c.
 333  334   */
 334  335  extern void __throw_constraint_handler_s(const char *_RESTRICT_KYWD, int);
 335  336  
 336  337  /*
 337  338   * defined in assfail.c.
 338  339   */
  
    | 
      ↓ open down ↓ | 
    96 lines elided | 
    
      ↑ open up ↑ | 
  
 339  340  extern void common_panic(const char *, const char *);
 340  341  
 341  342  /*
 342  343   * defined in mbrtowc.c.
 343  344   */
 344  345  extern size_t mbrtowc_nz_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
 345  346      size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
 346  347  extern size_t mbrtowc_nz(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
 347  348      size_t, mbstate_t *_RESTRICT_KYWD);
 348  349  
      350 +/*
      351 + * defined in getauxv.c.
      352 + */
      353 +extern long ___getauxval(int);
      354 +extern void *___getauxptr(int);
      355 +
 349  356  #ifdef  __cplusplus
 350  357  }
 351  358  #endif
 352  359  
 353  360  #endif /* _LIBC_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX