[Commits] SDL: SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in ...

libsdl.org revision control commits-owner at libsdl.org
Thu Sep 27 01:55:23 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/f72836cfb92b
changeset: 12241:f72836cfb92b
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Thu Sep 27 11:55:02 2018 +0300
description:
SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm.

diffstat:

 src/atomic/SDL_atomic.c   |  3 ++-
 src/atomic/SDL_spinlock.c |  2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 08b190d518fc -r f72836cfb92b src/atomic/SDL_atomic.c
--- a/src/atomic/SDL_atomic.c	Thu Sep 27 09:37:36 2018 +0300
+++ b/src/atomic/SDL_atomic.c	Thu Sep 27 11:55:02 2018 +0300
@@ -53,10 +53,11 @@
 #endif
 
 #if defined(__WATCOMC__) && defined(__386__)
+SDL_COMPILE_TIME_ASSERT(intsize, 4==sizeof(int));
 #define HAVE_WATCOM_ATOMICS
 extern _inline int _SDL_xchg_watcom(volatile int *a, int v);
 #pragma aux _SDL_xchg_watcom = \
-  "xchg [ecx], eax" \
+  "lock xchg [ecx], eax" \
   parm [ecx] [eax] \
   value [eax] \
   modify exact [eax];
diff -r 08b190d518fc -r f72836cfb92b src/atomic/SDL_spinlock.c
--- a/src/atomic/SDL_spinlock.c	Thu Sep 27 09:37:36 2018 +0300
+++ b/src/atomic/SDL_spinlock.c	Thu Sep 27 11:55:02 2018 +0300
@@ -40,7 +40,7 @@
 SDL_COMPILE_TIME_ASSERT(locksize, 4==sizeof(SDL_SpinLock));
 extern _inline int _SDL_xchg_watcom(volatile int *a, int v);
 #pragma aux _SDL_xchg_watcom = \
-  "xchg [ecx], eax" \
+  "lock xchg [ecx], eax" \
   parm [ecx] [eax] \
   value [eax] \
   modify exact [eax];


More information about the commits mailing list