Skip to content

Commit

Permalink
SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Sep 27, 2018
1 parent bb5516a commit d9fb77a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/atomic/SDL_atomic.c
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/atomic/SDL_spinlock.c
Expand Up @@ -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];
Expand Down

0 comments on commit d9fb77a

Please sign in to comment.