--- BasiliskII/src/uae_cpu/spcflags.h 2002/09/01 15:17:13 1.1 +++ BasiliskII/src/uae_cpu/spcflags.h 2005/06/06 18:49:51 1.4 @@ -18,8 +18,14 @@ enum { SPCFLAG_TRACE = 0x08, SPCFLAG_DOTRACE = 0x10, SPCFLAG_DOINT = 0x20, +#if USE_JIT + SPCFLAG_JIT_END_COMPILE = 0x40, + SPCFLAG_JIT_EXEC_RETURN = 0x80, +#else SPCFLAG_JIT_END_COMPILE = 0, SPCFLAG_JIT_EXEC_RETURN = 0, +#endif + SPCFLAG_ALL = SPCFLAG_STOP | SPCFLAG_INT | SPCFLAG_BRK @@ -27,7 +33,9 @@ enum { | SPCFLAG_DOTRACE | SPCFLAG_DOINT | SPCFLAG_JIT_END_COMPILE - | SPCFLAG_JIT_EXEC_RETURN, + | SPCFLAG_JIT_EXEC_RETURN + , + SPCFLAG_ALL_BUT_EXEC_RETURN = SPCFLAG_ALL & ~SPCFLAG_JIT_EXEC_RETURN }; @@ -49,7 +57,7 @@ enum { regs.spcflags &= ~(m); \ } while (0) -#elif defined(__i386__) && defined(X86_ASSEMBLY) +#elif (defined(__i386__) || defined(__x86_64__)) && defined(X86_ASSEMBLY) #define HAVE_HARDWARE_LOCKS @@ -61,29 +69,25 @@ enum { __asm__ __volatile__("lock\n\tandl %1,%0" : "=m" (regs.spcflags) : "i" (~(m))); \ } while (0) -#elif defined(HAVE_PTHREADS) +#else #undef HAVE_HARDWARE_LOCKS -#include -extern pthread_mutex_t spcflags_lock; +#include "main.h" +extern B2_mutex *spcflags_lock; #define SPCFLAGS_SET(m) do { \ - pthread_mutex_lock(&spcflags_lock); \ + B2_lock_mutex(spcflags_lock); \ regs.spcflags |= (m); \ - pthread_mutex_unlock(&spcflags_lock); \ + B2_unlock_mutex(spcflags_lock); \ } while (0) #define SPCFLAGS_CLEAR(m) do { \ - pthread_mutex_lock(&spcflags_lock); \ + B2_lock_mutex(spcflags_lock); \ regs.spcflags &= ~(m); \ - pthread_mutex_unlock(&spcflags_lock); \ + B2_unlock_mutex(spcflags_lock); \ } while (0) -#else - -#error "Can't handle spcflags atomically!" - #endif #endif /* SPCFLAGS_H */