Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-11-11 14:56:01 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-11-11 14:56:01 +0400
commit0d963613b033823a337b02a45c6c867fec54a52f (patch)
tree0e76abc741ab011f8c639fb78f3f95107ef5e20a /winsup/cygwin/winbase.h
parent3211d6c91f4ee6336aba2b2afcdc87c452e24e84 (diff)
* winbase.h: Semi-reinstantiate to workaround lack inline assembler
implementation of InterlockedCompareExchange for i686 in Mingw64 headers. * pinfo.cc (pinfo::init): Remove unused variable mapaddr.
Diffstat (limited to 'winsup/cygwin/winbase.h')
-rw-r--r--winsup/cygwin/winbase.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/winsup/cygwin/winbase.h b/winsup/cygwin/winbase.h
new file mode 100644
index 000000000..ae4794cc4
--- /dev/null
+++ b/winsup/cygwin/winbase.h
@@ -0,0 +1,35 @@
+/* winbase.h
+
+ Copyright 2002, 2003, 2004, 2008, 2009, 2012 Red Hat, Inc.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#include_next "winbase.h"
+
+#ifndef _WINBASE2_H
+#define _WINBASE2_H
+
+#ifndef __x86_64__
+extern __inline__ LONG
+ilockcmpexch (volatile LONG *t, LONG v, LONG c)
+{
+ return
+ ({
+ register LONG ret __asm ("%eax");
+ __asm __volatile ("lock cmpxchgl %2, %1"
+ : "=a" (ret), "=m" (*t)
+ : "r" (v), "m" (*t), "0" (c)
+ : "memory");
+ ret;
+ });
+}
+
+#undef InterlockedCompareExchange
+#define InterlockedCompareExchange ilockcmpexch
+#undef InterlockedCompareExchangePointer
+#define InterlockedCompareExchangePointer(d,e,c) \
+ (PVOID)InterlockedCompareExchange((LONG volatile *)(d),(LONG)(e),(LONG)(c))
+#endif /* !__x86_64 */
+#endif /*_WINBASE2_H*/