Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit846319d

Browse files
committed
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.
1 parentf9244df commit846319d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎src/include/storage/s_lock.h

Lines changed: 12 additions & 12 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.136 2005/08/2614:47:35 tgl Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.137 2005/08/2622:04:42 tgl Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -464,25 +464,25 @@ typedef unsigned int slock_t;
464464
static __inline__int
465465
tas(volatileslock_t*lock)
466466
{
467-
registervolatileslock_t*__l=lock;
468-
registerint__r;
467+
registervolatileslock_t*_l=lock;
468+
registerint_res;
469+
registerint_tmp;
469470

470471
__asm__ __volatile__(
471472
" .set push \n"
472473
" .set mips2 \n"
473474
" .set noreorder \n"
474475
" .set nomacro \n"
475-
"1: ll %0, %1 \n"
476-
" bne %0, $0, 1f \n"
477-
" xori %0, 1 \n"
478-
" sc %0, %1 \n"
479-
" beq %0, $0, 1b \n"
480-
" sync \n"
476+
" ll %0, %2 \n"
477+
" or %1, %0, $1 \n"
478+
" sc %1, %2 \n"
479+
" xori %1, $1 \n"
480+
" or %0, %0, %1 \n"
481481
"1: .set pop "
482-
:"=&r" (__r),"+R" (*__l)
482+
:"=&r" (_res),"=&r" (_tmp),"+R" (*_l)
483483
:
484-
:"memory","cc");
485-
return__r;
484+
:"memory");
485+
return_res;
486486
}
487487

488488
#endif/* __mips__ && !__sgi */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp