newlib/winsup/mingw/mingwex/membarrier.c
Earnie Boyd 525800e855 * mingwex/membarrier.c: New file.
* mingwex/Makefile.in (DISTFILES): Add membarrier.c.
	(REPLACE_OBJS): Add membarrier.o.
2012-08-06 18:05:53 +00:00

20 lines
592 B
C

/**
* 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));
}