+2007-05-07 Hans Boehm <Hans.Boehm@hp.com> (with help from Philipp Zambelli)
+ * src/atomic_ops/sysdeps/msftc/x86.h: Don't just assume that mfence
+ is present.
+ * src/atomic_ops/sysdeps/gcc/arm.h (AO_test_and_set_full): Correct
+ oldval type.
+
+2006-11-09 Earl Chew (Agilent)
+ * msftc/x86.h: Follow Microsoft documentation and include
+ windows.h.
+
[1.2 release]
2006-07-11 Hans Boehm <Hans.Boehm@hp.com>
*
*/
-/* There exist multiprocessor SoC ARM processors, so this may actually */
-/* matter. */
+/* There exist multiprocessor SoC ARM processors, so this matters. */
+/* This needs to be augmented for later ARM (e.g. V7) procesors. */
/* I found a slide set that, if I read it correctly, claims that */
/* Loads followed by either a Load or Store are ordered, but nothing */
AO_INLINE AO_TS_VAL_t
AO_test_and_set_full(volatile AO_TS_t *addr) {
- int oldval;
+ AO_TS_VAL_t oldval;
/* SWP on ARM is very similar to XCHG on x86. */
/* The first operand is the result, the second the value */
/* to be stored. Both registers must be different from addr. */
#include "../test_and_set_t_is_char.h"
-#include <winbase.h>
+#include <windows.h>
+ /* Seems like over-kill, but that's what MSDN recommends. */
+ /* And apparently winbase.h is not always self-contained. */
#if _MSC_VER < 1310
/* As far as we can tell, the lfence and sfence instructions are not */
/* currently needed or useful for cached memory accesses. */
+/* Unfortunately mfence doesn't exist everywhere. */
+/* IsProcessorFeaturePresent(PF_COMPARE_EXCHANGE128) is */
+/* probably a conservative test for it? */
+
+#if defined(AO_USE_PENTIUM4_INSTRS)
+
AO_INLINE void
AO_nop_full()
{
#define AO_HAVE_nop_full
+#else
+
+/* We could use the cpuid instruction. But that seems to be slower */
+/* than the default implementation based on test_and_set_full. Thus */
+/* we omit that bit of misinformation here. */
+
+#endif
+
AO_INLINE AO_t
AO_fetch_and_add_full (volatile AO_t *p, AO_t incr)
{