mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Get the MIPS assembler syntax right. Also add a separate sync command;
the reference I consulted yesterday said SC does a SYNC, but apparently this is not true on newer MIPS processors, so be safe.
This commit is contained in:
parent
338e28e234
commit
5824d02155
@ -66,7 +66,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.137 2005/08/26 22:04:42 tgl Exp $
|
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.138 2005/08/27 16:22:48 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -455,6 +455,7 @@ do \
|
|||||||
|
|
||||||
#if defined(__mips__) && !defined(__sgi)
|
#if defined(__mips__) && !defined(__sgi)
|
||||||
/* Note: on SGI we use the OS' mutex ABI, see below */
|
/* Note: on SGI we use the OS' mutex ABI, see below */
|
||||||
|
/* Note: R10000 processors require a separate SYNC */
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
|
||||||
typedef unsigned int slock_t;
|
typedef unsigned int slock_t;
|
||||||
@ -474,11 +475,12 @@ tas(volatile slock_t *lock)
|
|||||||
" .set noreorder \n"
|
" .set noreorder \n"
|
||||||
" .set nomacro \n"
|
" .set nomacro \n"
|
||||||
" ll %0, %2 \n"
|
" ll %0, %2 \n"
|
||||||
" or %1, %0, $1 \n"
|
" or %1, %0, 1 \n"
|
||||||
" sc %1, %2 \n"
|
" sc %1, %2 \n"
|
||||||
" xori %1, $1 \n"
|
" xori %1, 1 \n"
|
||||||
" or %0, %0, %1 \n"
|
" or %0, %0, %1 \n"
|
||||||
"1: .set pop "
|
" sync \n"
|
||||||
|
" .set pop "
|
||||||
: "=&r" (_res), "=&r" (_tmp), "+R" (*_l)
|
: "=&r" (_res), "=&r" (_tmp), "+R" (*_l)
|
||||||
:
|
:
|
||||||
: "memory");
|
: "memory");
|
||||||
|
Loading…
Reference in New Issue
Block a user