SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm.
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 27 Sep 2018 11:55:02 +0300
changeset 12241f72836cfb92b
parent 12240 08b190d518fc
child 12242 df7260f149f2
SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm.
src/atomic/SDL_atomic.c
src/atomic/SDL_spinlock.c
     1.1 --- a/src/atomic/SDL_atomic.c	Thu Sep 27 09:37:36 2018 +0300
     1.2 +++ b/src/atomic/SDL_atomic.c	Thu Sep 27 11:55:02 2018 +0300
     1.3 @@ -53,10 +53,11 @@
     1.4  #endif
     1.5  
     1.6  #if defined(__WATCOMC__) && defined(__386__)
     1.7 +SDL_COMPILE_TIME_ASSERT(intsize, 4==sizeof(int));
     1.8  #define HAVE_WATCOM_ATOMICS
     1.9  extern _inline int _SDL_xchg_watcom(volatile int *a, int v);
    1.10  #pragma aux _SDL_xchg_watcom = \
    1.11 -  "xchg [ecx], eax" \
    1.12 +  "lock xchg [ecx], eax" \
    1.13    parm [ecx] [eax] \
    1.14    value [eax] \
    1.15    modify exact [eax];
     2.1 --- a/src/atomic/SDL_spinlock.c	Thu Sep 27 09:37:36 2018 +0300
     2.2 +++ b/src/atomic/SDL_spinlock.c	Thu Sep 27 11:55:02 2018 +0300
     2.3 @@ -40,7 +40,7 @@
     2.4  SDL_COMPILE_TIME_ASSERT(locksize, 4==sizeof(SDL_SpinLock));
     2.5  extern _inline int _SDL_xchg_watcom(volatile int *a, int v);
     2.6  #pragma aux _SDL_xchg_watcom = \
     2.7 -  "xchg [ecx], eax" \
     2.8 +  "lock xchg [ecx], eax" \
     2.9    parm [ecx] [eax] \
    2.10    value [eax] \
    2.11    modify exact [eax];