diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2001-03-15 13:22:35 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2001-03-15 13:22:35 +0000 |
commit | f6b99490d314856fe56d145096fcca5768836a99 (patch) | |
tree | 82a6be5cb715a0b871917256ba446a8239d30d56 /sal/osl | |
parent | 5ffe31b6c42d8d3c0f85624bb79e05d214741aa3 (diff) |
POWERPC: use fixed register
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/interlck.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c index 4a41c3224..cdb0298bc 100644 --- a/sal/osl/unx/interlck.c +++ b/sal/osl/unx/interlck.c @@ -2,9 +2,9 @@ * * $RCSfile: interlck.c,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: hr $ $Date: 2001-03-13 19:01:54 $ + * last change: $Author: hr $ $Date: 2001-03-15 14:22:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,32 +109,34 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* /*****************************************************************************/ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount) { - oslInterlockedCount nCount; + /* "addi" doesn't work with r0 as second parameter */ + register oslInterlockedCount nCount __asm__ ("r4"); __asm__ __volatile__ ( "1: lwarx %0,0,%2\n\t" - " addic %0,%0,1\n\t" + " addi %0,%0,1\n\t" " stwcx. %0,0,%2\n\t" " bne- 1b" : "=r" (nCount), "=m" (*pCount) : "r" (pCount) - : "cc", "memory"); + : "r4", "memory"); return nCount; } oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount) { - oslInterlockedCount nCount; + /* "subi" doesn't work with r0 as second parameter */ + register oslInterlockedCount nCount __asm__ ("r4"); __asm__ __volatile__ ( "1: lwarx %0,0,%2\n\t" - " subic %0,%0,1\n\t" + " subi %0,%0,1\n\t" " stwcx. %0,0,%2\n\t" " bne- 1b" : "=r" (nCount), "=m" (*pCount) : "r" (pCount) - : "cc", "memory"); + : "r4", "memory"); return nCount; } |