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:
authorEarnie Boyd <earnie@users.sf.net>2012-08-06 22:05:53 +0400
committerEarnie Boyd <earnie@users.sf.net>2012-08-06 22:05:53 +0400
commit525800e8559c46f015a59fed01d8d3336f26e92e (patch)
treef825baadbdc38664f575ddc5d89b82298b32bb6e /winsup/mingw
parent705d9e463cffacfc6d92a42e89a8fb2cd99546dd (diff)
* mingwex/membarrier.c: New file.
* mingwex/Makefile.in (DISTFILES): Add membarrier.c. (REPLACE_OBJS): Add membarrier.o.
Diffstat (limited to 'winsup/mingw')
-rw-r--r--winsup/mingw/ChangeLog6
-rw-r--r--winsup/mingw/mingwex/Makefile.in4
-rw-r--r--winsup/mingw/mingwex/membarrier.c19
3 files changed, 27 insertions, 2 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index 38ac9504d..d0667f7c3 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-06 Earnie Boyd <earnie@users.sourceforge.net>
+
+ * mingwex/membarrier.c: New file.
+ * mingwex/Makefile.in (DISTFILES): Add membarrier.c.
+ (REPLACE_OBJS): Add membarrier.o.
+
2012-08-02 Ivan Maidanski <ivmai@users.sourceforge.net>
* include/process.h (_wexec*, _wspawn*): Declare.
diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in
index 59ebac7e3..afe32e5be 100644
--- a/winsup/mingw/mingwex/Makefile.in
+++ b/winsup/mingw/mingwex/Makefile.in
@@ -40,7 +40,7 @@ DISTFILES = \
fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \
fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \
feupdateenv.c ftruncate.c fwide.c getopt.c imaxabs.c imaxdiv.c \
- lltoa.c lltow.c mbsinit.c mingw-aligned-malloc.c \
+ lltoa.c lltow.c mbsinit.c membarrier.c mingw-aligned-malloc.c \
mingw-fseek.c sitest.c strtoimax.c strtoumax.c \
testwmem.c tst-aligned-malloc.c ulltoa.c ulltow.c wcstof.c \
wcstoimax.c wcstold.c wcstoumax.c wctrans.c wctype.c \
@@ -201,7 +201,7 @@ POSIX_OBJS = \
dirent.o wdirent.o getopt.o ftruncate.o gettimeofday.o usleep.o \
basename.o dirname.o tsearch.o twalk.o tdelete.o tfind.o
REPLACE_OBJS = \
- mingw-aligned-malloc.o mingw-fseek.o
+ membarrier.o mingw-aligned-malloc.o mingw-fseek.o
COMPLEX_OBJS = \
cabs.o cabsf.o cabsl.o cacos.o cacosf.o cacosl.o cacosh.o \
cacoshf.o cacoshl.o carg.o cargf.o cargl.o casin.o casinf.o \
diff --git a/winsup/mingw/mingwex/membarrier.c b/winsup/mingw/mingwex/membarrier.c
new file mode 100644
index 000000000..b8da9f7de
--- /dev/null
+++ b/winsup/mingw/mingwex/membarrier.c
@@ -0,0 +1,19 @@
+/**
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+void __mingworg_MemoryBarrier(void);
+void __mingworg_MemoryBarrier(void)
+{
+ long Barrier = 0;
+ __asm__ __volatile__("xchgl %%eax,%0 "
+ :"=r" (Barrier));
+}
+