From: Mathieu Desnoyers Date: Thu, 8 Oct 2009 04:56:59 +0000 (-0400) Subject: add CONFIG_HAVE_FENCE on x86's newer than i586 X-Git-Tag: v0.2.3~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=90586875e92a9cdc6c7088d8e9815a6a0f54beb1;p=userspace-rcu.git add CONFIG_HAVE_FENCE on x86's newer than i586 Patch originally from Pierre-Marc Fournier, modified. Signed-off-by: Mathieu Desnoyers --- diff --git a/configure.ac b/configure.ac index 422b11b..a4e675f 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,8 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) AC_CONFIG_SRCDIR([urcu.h]) AH_TEMPLATE([CONFIG_SMP], [Enable SMP support. With SMP support enabled, uniprocessors are also supported. With SMP support disabled, UP systems work fine, but the behavior of SMP systems is undefined.]) +AH_TEMPLATE([CONFIG_HAVE_FENCE], [Defined when on a system that has memory fence +instructions.]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. @@ -49,6 +51,15 @@ fi AC_SUBST(ARCHTYPE) AC_SUBST(SUBARCHTYPE) +[ +if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != +"xi486" -a "x$target_cpu" != "xi586"; then +] + AC_DEFINE([CONFIG_HAVE_FENCE], [1]) +[ +fi +] + AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc]) AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" == xx86compat ]) diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h index 806878e..7d3d76d 100644 --- a/urcu/arch_x86.h +++ b/urcu/arch_x86.h @@ -25,8 +25,6 @@ #include #include "config.h" -/* Assume P4 or newer */ -#define CONFIG_HAVE_FENCE 1 #define CONFIG_HAVE_MEM_COHERENCY #define CACHE_LINE_SIZE 128