Skip to content

Commit 5824d02

Browse files
committed
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.
1 parent 338e28e commit 5824d02

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/include/storage/s_lock.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
69-
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.137 2005/08/26 22:04:42 tgl Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.138 2005/08/27 16:22:48 tgl Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -455,6 +455,7 @@ do \
455455

456456
#if defined(__mips__) && !defined(__sgi)
457457
/* Note: on SGI we use the OS' mutex ABI, see below */
458+
/* Note: R10000 processors require a separate SYNC */
458459
#define HAS_TEST_AND_SET
459460

460461
typedef unsigned int slock_t;
@@ -474,11 +475,12 @@ tas(volatile slock_t *lock)
474475
" .set noreorder \n"
475476
" .set nomacro \n"
476477
" ll %0, %2 \n"
477-
" or %1, %0, $1 \n"
478+
" or %1, %0, 1 \n"
478479
" sc %1, %2 \n"
479-
" xori %1, $1 \n"
480+
" xori %1, 1 \n"
480481
" or %0, %0, %1 \n"
481-
"1: .set pop "
482+
" sync \n"
483+
" .set pop "
482484
: "=&r" (_res), "=&r" (_tmp), "+R" (*_l)
483485
:
484486
: "memory");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy