Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/m9x/__fex_hdlr.c
          +++ new/usr/src/lib/libm/common/m9x/__fex_hdlr.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30      -#include "fenv_synonyms.h"
  31   30  #undef lint
  32   31  #include <signal.h>
  33   32  #include <siginfo.h>
  34   33  #include <ucontext.h>
  35   34  #include <stdio.h>
  36   35  #include <stdlib.h>
  37   36  #include <unistd.h>
  38   37  #include <thread.h>
  39   38  #include <math.h>
  40   39  #if defined(__SUNPRO_C)
↓ open down ↓ 9 lines elided ↑ open up ↑
  50   49  
  51   50  /* 2.x signal.h doesn't declare sigemptyset or sigismember
  52   51     if they're #defined (see sys/signal.h) */
  53   52  extern int sigemptyset(sigset_t *);
  54   53  extern int sigismember(const sigset_t *, int);
  55   54  
  56   55  /* external globals */
  57   56  void (*__mt_fex_sync)() = NULL; /* for synchronization with libmtsk */
  58   57  #pragma weak __mt_fex_sync
  59   58  
  60      -#ifdef LIBM_MT_FEX_SYNC
  61   59  void (*__libm_mt_fex_sync)() = NULL; /* new, improved version of above */
  62   60  #pragma weak __libm_mt_fex_sync
  63      -#endif
  64   61  
  65   62  /* private variables */
  66   63  static fex_handler_t main_handlers;
  67   64  static int handlers_initialized = 0;
  68   65  static thread_key_t handlers_key;
  69   66  static mutex_t handlers_key_lock = DEFAULTMUTEX;
  70   67  
  71   68  static struct sigaction oact = { 0, SIG_DFL };
  72   69  static mutex_t hdlr_lock = DEFAULTMUTEX;
  73   70  static int hdlr_installed = 0;
↓ open down ↓ 64 lines elided ↑ open up ↑
 138  135                          env_initialized = 1;
 139  136                  }
 140  137                  else if (env_initialized)
 141  138                          (void) fesetenv(&master_env);
 142  139                  mutex_unlock(&env_lock);
 143  140          }
 144  141          else if (master && fex_get_log())
 145  142                  __fex_update_te();
 146  143  }
 147  144  
 148      -#ifdef LIBM_MT_FEX_SYNC
 149  145  /*
 150  146  *  The following function may be used for synchronization with any
 151  147  *  internal project that manages multiple threads
 152  148  */
 153  149  enum __libm_mt_fex_sync_actions {
 154  150          __libm_mt_fex_start_master = 0,
 155  151          __libm_mt_fex_start_slave,
 156  152          __libm_mt_fex_finish_master,
 157  153          __libm_mt_fex_finish_slave
 158  154  };
↓ open down ↓ 38 lines elided ↑ open up ↑
 197  193                  {
 198  194                          unsigned long   fsr;
 199  195                          __fenv_getfsr(&fsr);
 200  196                          __fenv_set_te(fsr, 0);
 201  197                          __fenv_setfsr(&fsr);
 202  198                  }
 203  199  #endif
 204  200                  break;
 205  201          }
 206  202  }
 207      -#endif
 208  203  
 209  204  #if defined(__sparc)
 210  205  
 211  206  /*
 212  207  *  Code for setting or clearing interval mode on US-III and above.
 213  208  *  This is embedded as data so we don't have to mark the library
 214  209  *  as a v8plusb/v9b object.  (I could have just used one entry and
 215  210  *  modified the second word to set the bits I want, but that would
 216  211  *  have required another mutex.)
 217  212  */
↓ open down ↓ 617 lines elided ↑ open up ↑
 835  830          /* set the new trap enable bits (only if SIGFPE is not blocked) */
 836  831          if (sigprocmask(0, NULL, &blocked) == 0 &&
 837  832                  !sigismember(&blocked, SIGFPE)) {
 838  833                  __fenv_set_te(fsr, te);
 839  834                  __fenv_setfsr(&fsr);
 840  835          }
 841  836  
 842  837          /* synchronize with libmtsk */
 843  838          __mt_fex_sync = __fex_sync_with_libmtsk;
 844  839  
 845      -#ifdef LIBM_MT_FEX_SYNC
 846  840          /* synchronize with other projects */
 847  841          __libm_mt_fex_sync = __fex_sync_with_threads;
 848      -#endif
 849  842  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX