diff options
author | unknown <heikki@donna.mysql.fi> | 2001-05-26 21:58:59 +0300 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-05-26 21:58:59 +0300 |
commit | 860d2b392a542f42ad60e12382fced1068c04c20 (patch) | |
tree | bf62d04e36a4bbb5ec3fa445cca8e6c5ecf95f57 /innobase | |
parent | 714640bfb9f725f05567c58fac34612e3e99df33 (diff) | |
download | mariadb-git-860d2b392a542f42ad60e12382fced1068c04c20.tar.gz |
sync0sync.ic InnoDB now uses XCHG to implement mutex if GCC and x86
configure.in InnoDB now uses XCHG to implement mutex if GCC and x86
innobase/configure.in:
InnoDB now uses XCHG to implement mutex if GCC and x86
innobase/include/sync0sync.ic:
InnoDB now uses XCHG to implement mutex if GCC and x86
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/configure.in | 5 | ||||
-rw-r--r-- | innobase/include/sync0sync.ic | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/innobase/configure.in b/innobase/configure.in index 83d302c6dc4..1133ab86221 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -95,6 +95,11 @@ case "$target_os" in CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; esac +case "$target" in + i[[4567]]86-*-*) + CFLAGS="$CFLAGS -DUNIV_INTEL_X86";; +esac + AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile buf/Makefile com/Makefile data/Makefile dict/Makefile dyn/Makefile diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index a937ac5d579..e23e2b68e14 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -86,6 +86,20 @@ mutex_test_and_set( /* mutex_fence(); */ return(res); +#elif defined(__GNUC__) && defined(UNIV_INTEL_X86) + ulint* lw; + ulint res; + + lw = &(mutex->lock_word); + + /* In assembly we use the so-called AT & T syntax where + the order of operands is inverted compared to the ordinary Intel + syntax. The 'l' after the mnemonics denotes a 32-bit operation. */ + + asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" : + "=eax" (res): + "ecx" (lw)); + return(res); #else ibool ret; |