diff options
author | Rickard Green <rickard@erlang.org> | 2010-09-10 09:59:23 +0200 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2010-09-10 09:59:23 +0200 |
commit | d90480306e4fcd3abc9717034a38868f639d45b1 (patch) | |
tree | 794e1ad12fa6618bd484b821f52d353d74879569 /erts | |
parent | 358eaf9d14a0102eaca5bb482d03d4fc37639724 (diff) | |
parent | 6412564cadfb99c0c2a5089f07e4a0a02f13902c (diff) | |
download | otp-d90480306e4fcd3abc9717034a38868f639d45b1.tar.gz otp-d90480306e4fcd3abc9717034a38868f639d45b1.tar.bz2 otp-d90480306e4fcd3abc9717034a38868f639d45b1.zip |
Merge branch 'sv/ethread-atomic-mips' into dev
* sv/ethread-atomic-mips:
add MIPS architecture to GCC ethread atomics support
Diffstat (limited to 'erts')
-rw-r--r-- | erts/include/internal/gcc/ethr_atomic.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/include/internal/gcc/ethr_atomic.h b/erts/include/internal/gcc/ethr_atomic.h index 5fe6e23477..e8e529dd48 100644 --- a/erts/include/internal/gcc/ethr_atomic.h +++ b/erts/include/internal/gcc/ethr_atomic.h @@ -31,7 +31,7 @@ #define ETHR_IMMED_ATOMIC_SET_GET_SAFE__ 0 /* Enable immediate read/write on platforms where we know it is safe */ #if defined(__i386__) || defined(__x86_64__) || defined(__sparc__) \ - || defined(__powerpc__) || defined(__ppc__) + || defined(__powerpc__) || defined(__ppc__) || defined(__mips__) # undef ETHR_IMMED_ATOMIC_SET_GET_SAFE__ # define ETHR_IMMED_ATOMIC_SET_GET_SAFE__ 1 #endif @@ -48,13 +48,18 @@ typedef struct { * a noop on at least some platforms with some gcc versions. * This has suposedly been fixed in some gcc version, but we * don't know from which version. Therefore, we use the - * workaround implemented below on all gcc versions. + * workaround implemented below on all gcc versions except + * for gcc 4.2 or above for MIPS, where it's been verified. */ +#if defined(__mips__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#define ETHR_MEMORY_BARRIER __sync_synchronize() +#else #define ETHR_MEMORY_BARRIER \ do { \ volatile long x___ = 0; \ (void) __sync_val_compare_and_swap(&x___, (long) 0, (long) 1); \ } while (0) +#endif #define ETHR_READ_DEPEND_MEMORY_BARRIER ETHR_MEMORY_BARRIER #if defined(ETHR_TRY_INLINE_FUNCS) || defined(ETHR_AUX_IMPL__) |