Print this page
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local

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 ↓ 49 lines elided ↑ open up ↑
  50   50  
  51   51  /* 2.x signal.h doesn't declare sigemptyset or sigismember
  52   52     if they're #defined (see sys/signal.h) */
  53   53  extern int sigemptyset(sigset_t *);
  54   54  extern int sigismember(const sigset_t *, int);
  55   55  
  56   56  /* external globals */
  57   57  void (*__mt_fex_sync)() = NULL; /* for synchronization with libmtsk */
  58   58  #pragma weak __mt_fex_sync
  59   59  
  60      -#ifdef LIBM_MT_FEX_SYNC
  61   60  void (*__libm_mt_fex_sync)() = NULL; /* new, improved version of above */
  62   61  #pragma weak __libm_mt_fex_sync
  63      -#endif
  64   62  
  65   63  /* private variables */
  66   64  static fex_handler_t main_handlers;
  67   65  static int handlers_initialized = 0;
  68   66  static thread_key_t handlers_key;
  69   67  static mutex_t handlers_key_lock = DEFAULTMUTEX;
  70   68  
  71   69  static struct sigaction oact = { 0, SIG_DFL };
  72   70  static mutex_t hdlr_lock = DEFAULTMUTEX;
  73   71  static int hdlr_installed = 0;
↓ open down ↓ 64 lines elided ↑ open up ↑
 138  136                          env_initialized = 1;
 139  137                  }
 140  138                  else if (env_initialized)
 141  139                          (void) fesetenv(&master_env);
 142  140                  mutex_unlock(&env_lock);
 143  141          }
 144  142          else if (master && fex_get_log())
 145  143                  __fex_update_te();
 146  144  }
 147  145  
 148      -#ifdef LIBM_MT_FEX_SYNC
 149  146  /*
 150  147  *  The following function may be used for synchronization with any
 151  148  *  internal project that manages multiple threads
 152  149  */
 153  150  enum __libm_mt_fex_sync_actions {
 154  151          __libm_mt_fex_start_master = 0,
 155  152          __libm_mt_fex_start_slave,
 156  153          __libm_mt_fex_finish_master,
 157  154          __libm_mt_fex_finish_slave
 158  155  };
↓ open down ↓ 38 lines elided ↑ open up ↑
 197  194                  {
 198  195                          unsigned long   fsr;
 199  196                          __fenv_getfsr(&fsr);
 200  197                          __fenv_set_te(fsr, 0);
 201  198                          __fenv_setfsr(&fsr);
 202  199                  }
 203  200  #endif
 204  201                  break;
 205  202          }
 206  203  }
 207      -#endif
 208  204  
 209  205  #if defined(__sparc)
 210  206  
 211  207  /*
 212  208  *  Code for setting or clearing interval mode on US-III and above.
 213  209  *  This is embedded as data so we don't have to mark the library
 214  210  *  as a v8plusb/v9b object.  (I could have just used one entry and
 215  211  *  modified the second word to set the bits I want, but that would
 216  212  *  have required another mutex.)
 217  213  */
↓ open down ↓ 617 lines elided ↑ open up ↑
 835  831          /* set the new trap enable bits (only if SIGFPE is not blocked) */
 836  832          if (sigprocmask(0, NULL, &blocked) == 0 &&
 837  833                  !sigismember(&blocked, SIGFPE)) {
 838  834                  __fenv_set_te(fsr, te);
 839  835                  __fenv_setfsr(&fsr);
 840  836          }
 841  837  
 842  838          /* synchronize with libmtsk */
 843  839          __mt_fex_sync = __fex_sync_with_libmtsk;
 844  840  
 845      -#ifdef LIBM_MT_FEX_SYNC
 846  841          /* synchronize with other projects */
 847  842          __libm_mt_fex_sync = __fex_sync_with_threads;
 848      -#endif
 849  843  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX