diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-26 22:04:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-26 22:04:53 +0000 |
commit | 51aebb07c3264aec2048aa3a117ebd25fb2976e0 (patch) | |
tree | 0093bccdc94dc53c921b3545469cf4aa8e258877 /src | |
parent | 8c3cf25225629b276066299387bfd41a0d756fff (diff) | |
download | postgresql-51aebb07c3264aec2048aa3a117ebd25fb2976e0.tar.gz postgresql-51aebb07c3264aec2048aa3a117ebd25fb2976e0.zip |
Another try at the inlined MIPS spinlock code. Can't test this myself,
but for sure it's not any more broken than the prior version.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/storage/s_lock.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 2fd7988e5e5..d7dde21a5e2 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -66,7 +66,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.133.4.1 2005/08/26 14:48:13 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.133.4.2 2005/08/26 22:04:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -449,25 +449,25 @@ typedef unsigned int slock_t; static __inline__ int tas(volatile slock_t *lock) { - register volatile slock_t *__l = lock; - register int __r; + register volatile slock_t *_l = lock; + register int _res; + register int _tmp; __asm__ __volatile__( " .set push \n" " .set mips2 \n" " .set noreorder \n" " .set nomacro \n" - "1: ll %0, %1 \n" - " bne %0, $0, 1f \n" - " xori %0, 1 \n" - " sc %0, %1 \n" - " beq %0, $0, 1b \n" - " sync \n" + " ll %0, %2 \n" + " or %1, %0, $1 \n" + " sc %1, %2 \n" + " xori %1, $1 \n" + " or %0, %0, %1 \n" "1: .set pop " -: "=&r" (__r), "+R" (*__l) +: "=&r" (_res), "=&r" (_tmp), "+R" (*_l) : -: "memory", "cc"); - return __r; +: "memory"); + return _res; } #endif /* __mips__ && !__sgi */ |