ISC_ARCH_DIR
ISC_PLATFORM_USEMACASM
ISC_PLATFORM_USESTDASM
-ISC_PLATFORM_USEOSFASM
ISC_PLATFORM_USEGCCASM
ISC_PLATFORM_HAVEATOMICSTOREQ
ISC_PLATFORM_HAVEATOMICSTORE
-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"
arch=x86_32
fi
;;
- alpha*-*)
- arch=alpha
- ;;
powerpc-*|powerpc64-*)
arch=powerpc
;;
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)
;;
*)
-
ISC_ARCH_DIR=$arch
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"
arch=x86_32
fi
;;
- alpha*-*)
- arch=alpha
- ;;
powerpc-*|powerpc64-*)
arch=powerpc
;;
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)
;;
*)
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)
#include <isc/platform.h>
#include <isc/types.h>
-#ifdef ISC_PLATFORM_USEOSFASM
-#include <c_asm.h>
-
-#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;
*/
@ISC_PLATFORM_USEGCCASM@
-/*
- * Define if Tru64 style ASM syntax must be used.
- */
-@ISC_PLATFORM_USEOSFASM@
-
/*
* Define if the standard __asm function must be used.
*/
isc__timermgr_t *manager;
isc_time_t due;
int cmp;
- bool timedwait;
/*!
* Note: the caller must ensure locking.
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.
*/
* 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,