From d9fb77a3c196e4091e9150df3c4cfca4d7e8a372 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 27 Sep 2018 11:55:02 +0300 Subject: [PATCH] SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm. --- src/atomic/SDL_atomic.c | 3 ++- src/atomic/SDL_spinlock.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index df4920139c8cb..d0022cdc17746 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -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 --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index cbc1056c985ff..6a7b14a981b8d 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -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];