PowerPC volatile interlocked
Pierre d'Herbemont
stegefin at free.fr
Tue Jul 22 14:39:30 CDT 2003
Hi!
When gcc has its optimisation turned on, we should to specify
__volatile__ for inline-ed assembler code. Without this patch you can't
open an SaveDialog box on darwin/ppc, and probably can't do a lot of
other things which needs InterlockedIncrement().
ChangeLog:
- Make the PowerPC interlocked assembler code volatile.
-------------- next part --------------
Index: include/winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.186
diff -u -r1.186 winbase.h
--- include/winbase.h 21 Jul 2003 20:05:11 -0000 1.186
+++ include/winbase.h 22 Jul 2003 19:33:28 -0000
@@ -1998,7 +1998,7 @@
{
LONG ret = 0;
LONG scratch;
- __asm__ (
+ __asm__ __volatile__(
"0: lwarx %0,0,%2\n"
" xor. %1,%4,%0\n"
" bne 1f\n"
@@ -2016,7 +2016,7 @@
extern inline LONG WINAPI InterlockedExchange( PLONG dest, LONG val )
{
LONG ret = 0;
- __asm__(
+ __asm__ __volatile__(
"0: lwarx %0,0,%1\n"
" stwcx. %2,0,%1\n"
" bne- 0b\n"
@@ -2032,7 +2032,7 @@
{
LONG ret = 0;
LONG zero = 0;
- __asm__(
+ __asm__ __volatile__(
"0: lwarx %0, %3, %1\n"
" add %0, %2, %0\n"
" stwcx. %0, %3, %1\n"
More information about the wine-patches
mailing list