s_lock patch from Ryan.
This commit is contained in:
parent
47ea32f7d4
commit
2e18525dbe
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.55 1998/10/28 15:58:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.56 1998/10/31 02:06:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -86,18 +86,18 @@ tas(volatile slock_t *lock)
|
|||
register slock_t _res;
|
||||
|
||||
__asm__(" ldq $0, %0 \n\
|
||||
bne $0, already_set \n\
|
||||
bne $0, 3f \n\
|
||||
ldq_l $0, %0 \n\
|
||||
bne $0, already_set \n\
|
||||
bne $0, 3f \n\
|
||||
or $31, 1, $0 \n\
|
||||
stq_c $0, %0 \n\
|
||||
beq $0, stqc_fail \n\
|
||||
success: bis $31, $31, %1 \n\
|
||||
beq $0, 2f \n\
|
||||
bis $31, $31, %1 \n\
|
||||
mb \n\
|
||||
jmp $31, end \n\
|
||||
stqc_fail: or $31, 1, $0 \n\
|
||||
already_set: bis $0, $0, %1 \n\
|
||||
end: nop ": "=m"(*lock), "=r"(_res): :"0");
|
||||
jmp $31, 4f \n\
|
||||
2: or $31, 1, $0 \n\
|
||||
3: bis $0, $0, %1 \n\
|
||||
4: nop ": "=m"(*lock), "=r"(_res): :"0");
|
||||
|
||||
return (int) _res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue