Mercurial > unleashed > wips
changeset 20680:5c100ec33983 draft
libm: remove __libm_mt_fex_sync & __mt_fex_sync
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Wed, 22 May 2019 19:55:32 -0400 |
parents | b10c00ebd130 |
children | 4d30bf4a8076 |
files | FEATURES.txt lib/libm/common/m9x/__fex_hdlr.c lib/libm/common/mapfile-vers |
diffstat | 3 files changed, 2 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- a/FEATURES.txt Wed May 22 15:10:16 2019 -0400 +++ b/FEATURES.txt Wed May 22 19:55:32 2019 -0400 @@ -13,7 +13,8 @@ - /etc/[uw]tmpx symlink - /usr/adm symlink - legacy accounting and reporting - - libm's __libm_errno symbol + - libm's symbols: + - __libm_errno, __mt_fex_sync, __libm_mt_fex_sync * moved all /var/adm files to /var/log * moved /var/svc/log to /var/log/svc
--- a/lib/libm/common/m9x/__fex_hdlr.c Wed May 22 15:10:16 2019 -0400 +++ b/lib/libm/common/m9x/__fex_hdlr.c Wed May 22 19:55:32 2019 -0400 @@ -49,13 +49,6 @@ extern int sigemptyset(sigset_t *); extern int sigismember(const sigset_t *, int); -/* external globals */ -void (*__mt_fex_sync)() = NULL; /* for synchronization with libmtsk */ -#pragma weak __mt_fex_sync - -void (*__libm_mt_fex_sync)() = NULL; /* new, improved version of above */ -#pragma weak __libm_mt_fex_sync - /* private variables */ static fex_handler_t main_handlers; static int handlers_initialized = 0; @@ -115,89 +108,6 @@ return te; } -/* -* The following function synchronizes with libmtsk (SPARC only, for now) -*/ -static void -__fex_sync_with_libmtsk(int begin, int master) -{ - static fenv_t master_env; - static int env_initialized = 0; - static mutex_t env_lock = DEFAULTMUTEX; - - if (begin) { - mutex_lock(&env_lock); - if (master) { - (void) fegetenv(&master_env); - env_initialized = 1; - } - else if (env_initialized) - (void) fesetenv(&master_env); - mutex_unlock(&env_lock); - } - else if (master && fex_get_log()) - __fex_update_te(); -} - -/* -* The following function may be used for synchronization with any -* internal project that manages multiple threads -*/ -enum __libm_mt_fex_sync_actions { - __libm_mt_fex_start_master = 0, - __libm_mt_fex_start_slave, - __libm_mt_fex_finish_master, - __libm_mt_fex_finish_slave -}; - -struct __libm_mt_fex_sync_data { - fenv_t master_env; - int initialized; - mutex_t lock; -}; - -static void -__fex_sync_with_threads(enum __libm_mt_fex_sync_actions action, - struct __libm_mt_fex_sync_data *thr_env) -{ - switch (action) { - case __libm_mt_fex_start_master: - mutex_lock(&thr_env->lock); - (void) fegetenv(&thr_env->master_env); - thr_env->initialized = 1; - mutex_unlock(&thr_env->lock); - break; - - case __libm_mt_fex_start_slave: - mutex_lock(&thr_env->lock); - if (thr_env->initialized) - (void) fesetenv(&thr_env->master_env); - mutex_unlock(&thr_env->lock); - break; - - case __libm_mt_fex_finish_master: -#if defined(__x86) - __fex_update_te(); -#else - if (fex_get_log()) - __fex_update_te(); -#endif - break; - - case __libm_mt_fex_finish_slave: -#if defined(__x86) - /* clear traps, making all accrued flags visible in status word */ - { - unsigned long fsr; - __fenv_getfsr(&fsr); - __fenv_set_te(fsr, 0); - __fenv_setfsr(&fsr); - } -#endif - break; - } -} - #if defined(__sparc) /* @@ -826,10 +736,4 @@ __fenv_set_te(fsr, te); __fenv_setfsr(&fsr); } - - /* synchronize with libmtsk */ - __mt_fex_sync = __fex_sync_with_libmtsk; - - /* synchronize with other projects */ - __libm_mt_fex_sync = __fex_sync_with_threads; }
--- a/lib/libm/common/mapfile-vers Wed May 22 15:10:16 2019 -0400 +++ b/lib/libm/common/mapfile-vers Wed May 22 19:55:32 2019 -0400 @@ -687,9 +687,6 @@ }; SYMBOL_VERSION SUNWprivate_1.3 { - global: - __libm_mt_fex_sync; # -lmtsk - __mt_fex_sync; # -lmtsk } SUNWprivate_1.2; SYMBOL_VERSION SUNWprivate_1.2 {