diff options
-rw-r--r-- | config.h.cmake | 1 | ||||
-rw-r--r-- | configure.cmake | 74 | ||||
-rw-r--r-- | include/atomic/gcc_builtins.h | 7 | ||||
-rw-r--r-- | include/atomic/generic-msvc.h | 5 | ||||
-rw-r--r-- | include/atomic/solaris.h | 9 | ||||
-rw-r--r-- | storage/perfschema/ha_perfschema.cc | 11 |
6 files changed, 33 insertions, 74 deletions
diff --git a/config.h.cmake b/config.h.cmake index 00aa03483ee..66f0acb1fcb 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -388,7 +388,6 @@ #cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1 -#cmakedefine MY_ATOMIC_MODE_DUMMY 1 #cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1 #cmakedefine HAVE_GCC_C11_ATOMICS 1 #cmakedefine HAVE_SOLARIS_ATOMIC 1 diff --git a/configure.cmake b/configure.cmake index 8dbc3aa18b5..b38bbcc0602 100644 --- a/configure.cmake +++ b/configure.cmake @@ -908,48 +908,38 @@ SET(SIGNAL_WITH_VIO_CLOSE 1) MARK_AS_ADVANCED(NO_ALARM) -IF(WITH_ATOMIC_OPS STREQUAL "up") - SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency") -ELSEIF(WITH_ATOMIC_OPS STREQUAL "smp") -ELSEIF(NOT WITH_ATOMIC_OPS) - CHECK_CXX_SOURCE_COMPILES(" - int main() - { - int foo= -10; int bar= 10; - long long int foo64= -10; long long int bar64= 10; - if (!__sync_fetch_and_add(&foo, bar) || foo) - return -1; - bar= __sync_lock_test_and_set(&foo, bar); - if (bar || foo != 10) - return -1; - bar= __sync_val_compare_and_swap(&bar, foo, 15); - if (bar) - return -1; - if (!__sync_fetch_and_add(&foo64, bar64) || foo64) - return -1; - bar64= __sync_lock_test_and_set(&foo64, bar64); - if (bar64 || foo64 != 10) - return -1; - bar64= __sync_val_compare_and_swap(&bar64, foo, 15); - if (bar64) - return -1; - return 0; - }" - HAVE_GCC_ATOMIC_BUILTINS) - CHECK_CXX_SOURCE_COMPILES(" - int main() - { - long long int var= 1; - long long int *ptr= &var; - return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); - }" - HAVE_GCC_C11_ATOMICS) -ELSE() - MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!") -ENDIF() - -SET(WITH_ATOMIC_OPS "${WITH_ATOMIC_OPS}" CACHE STRING "Implement atomic operations using atomic CPU instructions for multi-processor (smp) or uniprocessor (up) configuration. By default gcc built-in sync functions are used, if available and 'smp' configuration otherwise.") -MARK_AS_ADVANCED(WITH_ATOMIC_OPS MY_ATOMIC_MODE_DUMMY) +CHECK_CXX_SOURCE_COMPILES(" +int main() +{ + int foo= -10; int bar= 10; + long long int foo64= -10; long long int bar64= 10; + if (!__sync_fetch_and_add(&foo, bar) || foo) + return -1; + bar= __sync_lock_test_and_set(&foo, bar); + if (bar || foo != 10) + return -1; + bar= __sync_val_compare_and_swap(&bar, foo, 15); + if (bar) + return -1; + if (!__sync_fetch_and_add(&foo64, bar64) || foo64) + return -1; + bar64= __sync_lock_test_and_set(&foo64, bar64); + if (bar64 || foo64 != 10) + return -1; + bar64= __sync_val_compare_and_swap(&bar64, foo, 15); + if (bar64) + return -1; + return 0; +}" +HAVE_GCC_ATOMIC_BUILTINS) +CHECK_CXX_SOURCE_COMPILES(" +int main() +{ + long long int var= 1; + long long int *ptr= &var; + return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); +}" +HAVE_GCC_C11_ATOMICS) IF(WITH_VALGRIND) SET(HAVE_valgrind 1) diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h index 56a0323aedf..03472ec943c 100644 --- a/include/atomic/gcc_builtins.h +++ b/include/atomic/gcc_builtins.h @@ -26,12 +26,7 @@ sav= __sync_val_compare_and_swap(a, cmp_val, set);\ if (!(ret= (sav == cmp_val))) *cmp= sav -#ifdef MY_ATOMIC_MODE_DUMMY -#define make_atomic_load_body(S) ret= *a -#define make_atomic_store_body(S) *a= v -#define MY_ATOMIC_MODE "gcc-builtins-up" - -#elif defined(HAVE_GCC_C11_ATOMICS) +#if defined(HAVE_GCC_C11_ATOMICS) #define MY_ATOMIC_MODE "gcc-atomics-smp" #define make_atomic_load_body(S) \ ret= __atomic_load_n(a, __ATOMIC_SEQ_CST) diff --git a/include/atomic/generic-msvc.h b/include/atomic/generic-msvc.h index 2684a38b331..d06229ce5ef 100644 --- a/include/atomic/generic-msvc.h +++ b/include/atomic/generic-msvc.h @@ -17,11 +17,6 @@ #ifndef _atomic_h_cleanup_ #define _atomic_h_cleanup_ "atomic/generic-msvc.h" -/* - We don't implement anything specific for MY_ATOMIC_MODE_DUMMY, always use - intrinsics. -*/ - #include <windows.h> /* x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h index 7b6f0561ff0..578e7c46c7c 100644 --- a/include/atomic/solaris.h +++ b/include/atomic/solaris.h @@ -45,21 +45,12 @@ /* ------------------------------------------------------------------------ */ -#ifdef MY_ATOMIC_MODE_DUMMY - -#define make_atomic_load_body(S) ret= *a -#define make_atomic_store_body(S) *a= v - -#else /* MY_ATOMIC_MODE_DUMMY */ - #define make_atomic_load_body(S) \ ret= atomic_or_ ## S ## _nv((volatile uint ## S ## _t *)a, 0) #define make_atomic_store_body(S) \ (void) atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) -#endif - #define make_atomic_fas_body(S) \ v= atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index d703d5d594a..b94e65fc7d1 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -31,17 +31,6 @@ #include "pfs_user.h" #include "pfs_account.h" -#ifdef MY_ATOMIC_MODE_DUMMY -/* - The performance schema can can not function with MY_ATOMIC_MODE_DUMMY, - a fully functional implementation of MY_ATOMIC should be used instead. - If the build fails with this error message: - - either use a different ./configure --with-atomic-ops option - - or do not build with the performance schema. -*/ -#error "The performance schema needs a functional MY_ATOMIC implementation." -#endif - handlerton *pfs_hton= NULL; static handler* pfs_create_handler(handlerton *hton, |