summaryrefslogtreecommitdiff
path: root/sal/osl/unx/interlck.c
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-03-09 10:19:13 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-03-09 10:19:13 +0000
commit0c26267dc1157fa8ec9a5b39d34902dd3ee9d36f (patch)
tree20324083d7c9c1e5d448b3eb258be1ceb662e041 /sal/osl/unx/interlck.c
parent93e417a00d79f75be89825abdc78c4863d2b9dbd (diff)
INTEGRATION: CWS ooo20040225 (1.10.56); FILE MERGED
2004/02/16 19:51:24 svesik 1.10.56.1: Make interlock code work on both x86 (486+) and x86-64 Issue number: 8593 Submitted by: Pavel Janik Reviewed by: Sander Vesik, Dan Williams
Diffstat (limited to 'sal/osl/unx/interlck.c')
-rw-r--r--sal/osl/unx/interlck.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c
index 9458ec734142..ea248414690e 100644
--- a/sal/osl/unx/interlck.c
+++ b/sal/osl/unx/interlck.c
@@ -2,9 +2,9 @@
*
* $RCSfile: interlck.c,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: hjs $ $Date: 2003-08-18 15:18:36 $
+ * last change: $Author: hr $ $Date: 2004-03-09 11:19:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,8 @@
#error please use asm/interlck_sparc.s
#elif defined ( SOLARIS) && defined ( X86 )
#error please use asm/interlck_x86.s
-#elif defined ( GCC ) && defined ( X86 )
+#elif defined ( GCC ) && ( defined ( X86 ) || defined ( X86_64 ) )
+/* That's possible on x86-64 too since oslInterlockedCount is a sal_Int32 */
/*****************************************************************************/
/* osl_incrementInterlockedCount */
@@ -81,7 +82,7 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount*
__asm__ __volatile__ (
"movl $1, %0\n\t"
"lock\n\t"
- "xadd %0, %2\n\t"
+ "xaddl %0, %2\n\t"
"incl %0"
: "=&r" (nCount), "=m" (*pCount)
: "m" (*pCount)
@@ -97,7 +98,7 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
__asm__ __volatile__ (
"movl $-1, %0\n\t"
"lock\n\t"
- "xadd %0, %2\n\t"
+ "xaddl %0, %2\n\t"
"decl %0"
: "=&r" (nCount), "=m" (*pCount)
: "m" (*pCount)