Commit 7fac94f5 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Merge branch 'sparc-pause' into 'master'

configure.ac: autodetect 'pause' instruction presence on sparc

See merge request !2243
parents d3506c97 a5ad6b16
Pipeline #19302 passed with stages
in 1 minute and 6 seconds
......@@ -357,6 +357,9 @@
/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID
/* define if the SPARC pause instruction is available */
#undef HAVE_SPARC_PAUSE
/* define if struct stat has st_mtim.tv_nsec field */
#undef HAVE_STAT_NSEC
......
......@@ -13872,6 +13872,39 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; #(
;;
esac
 
#
# Check for pause support on SPARC processors
#
case $host in #(
sparc*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pause instruction support" >&5
$as_echo_n "checking for pause instruction support... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
__asm__ __volatile__ ("pause")
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_SPARC_PAUSE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; #(
*) :
;;
esac
for ac_func in sysctlbyname
do :
ac_fn_c_check_func "$LINENO" "sysctlbyname" "ac_cv_func_sysctlbyname"
......
......@@ -415,6 +415,20 @@ AS_CASE([$host],
[define if the ARM yield instruction is available])],
[AC_MSG_RESULT([no])])])
#
# Check for pause support on SPARC processors
#
AS_CASE([$host],
[sparc*],
[AC_MSG_CHECKING([for pause instruction support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]],
[[__asm__ __volatile__ ("pause")]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SPARC_PAUSE], [1],
[define if the SPARC pause instruction is available])],
[AC_MSG_RESULT([no])])])
AC_CHECK_FUNCS([sysctlbyname])
#
......
......@@ -152,7 +152,7 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
# define isc_rwlock_pause() __asm__ __volatile__ ("yield")
#elif defined(sun) && (defined(__sparc) || defined(__sparc__))
# define isc_rwlock_pause() smt_pause()
#elif defined(__sparc) || defined(__sparc__)
#elif (defined(__sparc) || defined(__sparc__)) && HAVE_SPARC_PAUSE
# define isc_rwlock_pause() __asm__ __volatile__ ("pause")
#elif defined(__ppc__) || defined(_ARCH_PPC) || \
defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_POWER)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment