From 18e3c8d2321dc0fb09f908e40f53dbe7560fcdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 21 Aug 2018 10:53:38 +0200 Subject: [PATCH] Remove legacy support for Tru64 --- configure | 35 ----------------- configure.in | 21 ---------- lib/isc/alpha/include/isc/atomic.h | 62 +----------------------------- lib/isc/include/isc/platform.h.in | 5 --- lib/isc/timer.c | 33 ---------------- 5 files changed, 1 insertion(+), 155 deletions(-) diff --git a/configure b/configure index b3241709a8..29c9233fb9 100755 --- a/configure +++ b/configure @@ -710,7 +710,6 @@ ISC_PLATFORM_BUSYWAITNOP ISC_ARCH_DIR ISC_PLATFORM_USEMACASM ISC_PLATFORM_USESTDASM -ISC_PLATFORM_USEOSFASM ISC_PLATFORM_USEGCCASM ISC_PLATFORM_HAVEATOMICSTOREQ ISC_PLATFORM_HAVEATOMICSTORE @@ -19550,7 +19549,6 @@ fi -ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM" ISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM" ISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM" ISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM" @@ -19608,9 +19606,6 @@ _ACEOF arch=x86_32 fi ;; - alpha*-*) - arch=alpha - ;; powerpc-*|powerpc64-*) arch=powerpc ;; @@ -19678,40 +19673,11 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - else - case "$host" in - alpha*-dec-osf*) - # Tru64 compiler has its own syntax for inline - # assembly. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -#ifndef __DECC -#error "unexpected compiler" -#endif - return (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - compiler=osf -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - esac fi case "$compiler" in gcc) ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1" ;; - osf) - ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1" - ;; mac) ;; *) @@ -19776,7 +19742,6 @@ fi - ISC_ARCH_DIR=$arch diff --git a/configure.in b/configure.in index f3e1f521de..fa2125e305 100644 --- a/configure.in +++ b/configure.in @@ -2824,7 +2824,6 @@ fi AC_SUBST(ISC_PLATFORM_HAVESTDATOMIC) -ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM" ISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM" ISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM" ISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM" @@ -2850,9 +2849,6 @@ if test "yes" = "$use_atomic"; then arch=x86_32 fi ;; - alpha*-*) - arch=alpha - ;; powerpc-*|powerpc64-*) arch=powerpc ;; @@ -2898,27 +2894,11 @@ if test "yes" = "$have_atomic"; then ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1" ], [AC_MSG_RESULT(no)]) fi - else - case "$host" in - alpha*-dec-osf*) - # Tru64 compiler has its own syntax for inline - # assembly. - AC_TRY_COMPILE(, [ -#ifndef __DECC -#error "unexpected compiler" -#endif - return (0);], - [compiler=osf],) - ;; - esac fi case "$compiler" in gcc) ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1" ;; - osf) - ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1" - ;; mac) ;; *) @@ -2964,7 +2944,6 @@ AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE) AC_SUBST(ISC_PLATFORM_HAVEATOMICSTOREQ) AC_SUBST(ISC_PLATFORM_USEGCCASM) -AC_SUBST(ISC_PLATFORM_USEOSFASM) AC_SUBST(ISC_PLATFORM_USESTDASM) AC_SUBST(ISC_PLATFORM_USEMACASM) diff --git a/lib/isc/alpha/include/isc/atomic.h b/lib/isc/alpha/include/isc/atomic.h index e704fef042..9e60912047 100644 --- a/lib/isc/alpha/include/isc/atomic.h +++ b/lib/isc/alpha/include/isc/atomic.h @@ -51,67 +51,7 @@ #include #include -#ifdef ISC_PLATFORM_USEOSFASM -#include - -#pragma intrinsic(asm) - -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. Memory access ordering around this function - * can be critical, so we add explicit memory block instructions at the - * beginning and the end of it (same for other functions). - */ -static inline int32_t -isc_atomic_xadd(int32_t *p, int32_t val) { - return (asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %t0, %v0;" /* copy the old value */ - "addl %t0, %a1, %t0;" /* calculate new value */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* spin if failed */ - "mb;", - p, val)); -} - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static inline void -isc_atomic_store(int32_t *p, int32_t val) { - (void)asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %a1, %t0;" /* value to store */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* spin if failed */ - "mb;", - p, val); -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static inline int32_t -isc_atomic_cmpxchg(int32_t *p, int32_t cmpval, int32_t val) { - - return(asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %t0, %v0;" /* copy the old value */ - "cmpeq %t0, %a1, %t0;" /* compare */ - "beq %t0, 2f;" /* exit if not equal */ - "mov %a2, %t0;" /* value to store */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* if it failed, spin */ - "2:" - "mb;", - p, cmpval, val)); -} -#elif defined (ISC_PLATFORM_USEGCCASM) +#if defined (ISC_PLATFORM_USEGCCASM) static inline int32_t isc_atomic_xadd(int32_t *p, int32_t val) { int32_t temp, prev; diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index 807ca9f3c6..5f10e621fe 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -266,11 +266,6 @@ */ @ISC_PLATFORM_USEGCCASM@ -/* - * Define if Tru64 style ASM syntax must be used. - */ -@ISC_PLATFORM_USEOSFASM@ - /* * Define if the standard __asm function must be used. */ diff --git a/lib/isc/timer.c b/lib/isc/timer.c index d85fe97069..65b72b882b 100644 --- a/lib/isc/timer.c +++ b/lib/isc/timer.c @@ -161,7 +161,6 @@ schedule(isc__timer_t *timer, isc_time_t *now, bool signal_ok) { isc__timermgr_t *manager; isc_time_t due; int cmp; - bool timedwait; /*! * Note: the caller must ensure locking. @@ -171,13 +170,6 @@ schedule(isc__timer_t *timer, isc_time_t *now, bool signal_ok) { manager = timer->manager; - /*! - * If the manager was timed wait, we may need to signal the - * manager to force a wakeup. - */ - timedwait = (manager->nscheduled > 0 && - isc_time_seconds(&manager->due) != 0); - /* * Compute the new due time. */ @@ -240,31 +232,6 @@ schedule(isc__timer_t *timer, isc_time_t *now, bool signal_ok) { * run thread, or explicitly setting the value in the manager. */ - /* - * This is a temporary (probably) hack to fix a bug on tru64 5.1 - * and 5.1a. Sometimes, pthread_cond_timedwait() doesn't actually - * return when the time expires, so here, we check to see if - * we're 15 seconds or more behind, and if we are, we signal - * the dispatcher. This isn't such a bad idea as a general purpose - * watchdog, so perhaps we should just leave it in here. - */ - if (signal_ok && timedwait) { - isc_interval_t fifteen; - isc_time_t then; - - isc_interval_set(&fifteen, 15, 0); - result = isc_time_add(&manager->due, &fifteen, &then); - - if (result == ISC_R_SUCCESS && - isc_time_compare(&then, now) < 0) { - SIGNAL(&manager->wakeup); - signal_ok = false; - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_TIMER, ISC_LOG_WARNING, - "*** POKED TIMER ***"); - } - } - if (timer->index == 1 && signal_ok) { XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SIGNALSCHED,