]> sourceware.org Git - newlib-cygwin.git/commitdiff
* include/winnt.h (MemoryBarrier): Add definition.
authorEarnie Boyd <earnie@users.sf.net>
Wed, 1 Aug 2012 19:17:37 +0000 (19:17 +0000)
committerEarnie Boyd <earnie@users.sf.net>
Wed, 1 Aug 2012 19:17:37 +0000 (19:17 +0000)
winsup/w32api/ChangeLog
winsup/w32api/include/winnt.h

index 38a2df19c5c5282814cc3fe433142034896fa2ce..16121619ccaa84b869ba6cfda82f4f2eab5e69ae 100644 (file)
@@ -15,6 +15,7 @@
        LONG WINAPI to LONG __cdecl to match Microsoft documentation.
        (InterlockedIncrement): Ditto.
        (InterlockedExchange): Ditto.
+       * include/winnt.h (MemoryBarrier): Add definition.
 
 2012-07-29  Earnie Boyd  <earnie@users.sourceforge.net>
 
index b31274bbe62321afb579e9bcbfaec89f55a4bc1d..24ce2de35b5a6a70988f2bd735a2f6585ec52e59 100644 (file)
@@ -4035,6 +4035,22 @@ struct _TEB * NtCurrentTeb(void);
 #endif /* __GNUC__ */
 #endif /* _X86_ */
 
+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
+# if defined(_AMD64_) || defined(__X86_64)
+#  define MemoryBarrier __faststorefence
+# elif defined(_IA64_)
+#  define MemoryBarrier __mf
+# else
+   FORCEINLINE VOID MemoryBarrier (VOID) {
+       LONG Barrier = 0;
+       __asm__ __volatile__("xchgl %%eax,%0 "
+         :"=r" (Barrier));
+   }
+# endif
+#else
+# define MemoryBarrier
+#endif
+
 #endif /* RC_INVOKED */
 
 #ifdef __cplusplus
This page took 0.043212 seconds and 5 git commands to generate.