diff options
author | unknown <lenz@mysql.com> | 2002-07-15 13:33:56 +0200 |
---|---|---|
committer | unknown <lenz@mysql.com> | 2002-07-15 13:33:56 +0200 |
commit | f9232ee50342699ddc1e43909ab2fed09db13766 (patch) | |
tree | 6ea8f94adc277510ee95c6b505ea9aaeba4364d1 /bdb | |
parent | 3814a0ff761cb486925beead1751af7a74fc7881 (diff) | |
download | mariadb-git-f9232ee50342699ddc1e43909ab2fed09db13766.tar.gz |
Added some patches provided by SuSE to fix build problems on
ppc64 and x86-64, fixed a compile bug when building with TCP wrapper
support on Linux
bdb/dist/acconfig.h:
Added patch for x86_64 (provided by SuSE)
bdb/dist/aclocal/mutex.m4:
Added patch for x86_64 (provided by SuSE)
bdb/include/mutex.h:
Added patch for x86_64 (provided by SuSE)
include/global.h:
Added a SMP-related patch for PPC64 (provided by SuSE)
sql/mysqld.cc:
Compile fix for Linux when compiling with --with-librwap
Diffstat (limited to 'bdb')
-rw-r--r-- | bdb/dist/acconfig.h | 1 | ||||
-rw-r--r-- | bdb/dist/aclocal/mutex.m4 | 12 | ||||
-rw-r--r-- | bdb/include/mutex.h | 22 |
3 files changed, 35 insertions, 0 deletions
diff --git a/bdb/dist/acconfig.h b/bdb/dist/acconfig.h index e30d0e3d2c2..19f85a460d9 100644 --- a/bdb/dist/acconfig.h +++ b/bdb/dist/acconfig.h @@ -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 diff --git a/bdb/dist/aclocal/mutex.m4 b/bdb/dist/aclocal/mutex.m4 index 5f16ee0e114..a6b1fa1a053 100644 --- a/bdb/dist/aclocal/mutex.m4 +++ b/bdb/dist/aclocal/mutex.m4 @@ -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(){ diff --git a/bdb/include/mutex.h b/bdb/include/mutex.h index a8a41451012..4c1b265355d 100644 --- a/bdb/include/mutex.h +++ b/bdb/include/mutex.h @@ -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. * |