Loading bdb/dist/acconfig.h +1 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #undef HAVE_MUTEX_WIN16 #undef HAVE_MUTEX_WIN32 #undef HAVE_MUTEX_X86_GCC_ASSEMBLY #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY /* Define if building on QNX. */ #undef HAVE_QNX Loading bdb/dist/aclocal/mutex.m4 +12 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,18 @@ AC_TRY_RUN([main(){ }], [db_cv_mutex="x86/gcc-assembly"]) fi dnl x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux if test "$db_cv_mutex" = no; then AC_TRY_RUN([main(){ #if defined(x86_64) || defined(__x86_64__) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }], [db_cv_mutex="x86_64/gcc-assembly"]) fi dnl ia86/gcc: Linux if test "$db_cv_mutex" = no; then AC_TRY_RUN([main(){ Loading bdb/include/mutex.h +22 −0 Original line number Diff line number Diff line Loading @@ -611,6 +611,28 @@ typedef unsigned char tsl_t; #endif #endif #ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY typedef unsigned char tsl_t; #ifdef LOAD_ACTUAL_MUTEX_CODE /* * For gcc/x86, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\ : "=&a" (__r), "=m" (*__l) \ : "1" (*__l) \ ); \ __r & 1; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) #endif #endif /* * Mutex alignment defaults to one byte. * Loading include/global.h +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ #endif /* In Linux-ia64 including atomic.h will give us an error */ #if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__ia64__)) || !defined(THREAD) #if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__) || defined(__powerpc64__))) || !defined(THREAD) #undef HAVE_ATOMIC_ADD #undef HAVE_ATOMIC_SUB #endif Loading Loading @@ -200,6 +200,7 @@ #endif #ifdef HAVE_ATOMIC_ADD #define __SMP__ #define CONFIG_SMP #include <asm/atomic.h> #endif Loading sql/mysqld.cc +5 −5 Original line number Diff line number Diff line Loading @@ -90,14 +90,14 @@ extern "C" { // Because of SCO 3.2V4.2 int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; #ifdef __linux__ #define my_fromhost(A) fromhost() #define my_hosts_access(A) hosts_access() #define my_eval_client(A) eval_client() #else #ifdef __STDC__ #define my_fromhost(A) fromhost(A) #define my_hosts_access(A) hosts_access(A) #define my_eval_client(A) eval_client(A) #else #define my_fromhost(A) fromhost() #define my_hosts_access(A) hosts_access() #define my_eval_client(A) eval_client() #endif #endif /* HAVE_LIBWRAP */ Loading Loading
bdb/dist/acconfig.h +1 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #undef HAVE_MUTEX_WIN16 #undef HAVE_MUTEX_WIN32 #undef HAVE_MUTEX_X86_GCC_ASSEMBLY #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY /* Define if building on QNX. */ #undef HAVE_QNX Loading
bdb/dist/aclocal/mutex.m4 +12 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,18 @@ AC_TRY_RUN([main(){ }], [db_cv_mutex="x86/gcc-assembly"]) fi dnl x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux if test "$db_cv_mutex" = no; then AC_TRY_RUN([main(){ #if defined(x86_64) || defined(__x86_64__) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }], [db_cv_mutex="x86_64/gcc-assembly"]) fi dnl ia86/gcc: Linux if test "$db_cv_mutex" = no; then AC_TRY_RUN([main(){ Loading
bdb/include/mutex.h +22 −0 Original line number Diff line number Diff line Loading @@ -611,6 +611,28 @@ typedef unsigned char tsl_t; #endif #endif #ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY typedef unsigned char tsl_t; #ifdef LOAD_ACTUAL_MUTEX_CODE /* * For gcc/x86, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\ : "=&a" (__r), "=m" (*__l) \ : "1" (*__l) \ ); \ __r & 1; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) #endif #endif /* * Mutex alignment defaults to one byte. * Loading
include/global.h +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ #endif /* In Linux-ia64 including atomic.h will give us an error */ #if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__ia64__)) || !defined(THREAD) #if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__) || defined(__powerpc64__))) || !defined(THREAD) #undef HAVE_ATOMIC_ADD #undef HAVE_ATOMIC_SUB #endif Loading Loading @@ -200,6 +200,7 @@ #endif #ifdef HAVE_ATOMIC_ADD #define __SMP__ #define CONFIG_SMP #include <asm/atomic.h> #endif Loading
sql/mysqld.cc +5 −5 Original line number Diff line number Diff line Loading @@ -90,14 +90,14 @@ extern "C" { // Because of SCO 3.2V4.2 int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; #ifdef __linux__ #define my_fromhost(A) fromhost() #define my_hosts_access(A) hosts_access() #define my_eval_client(A) eval_client() #else #ifdef __STDC__ #define my_fromhost(A) fromhost(A) #define my_hosts_access(A) hosts_access(A) #define my_eval_client(A) eval_client(A) #else #define my_fromhost(A) fromhost() #define my_hosts_access(A) hosts_access() #define my_eval_client(A) eval_client() #endif #endif /* HAVE_LIBWRAP */ Loading