mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
bring in alpha/linux s_lock changes
From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
# Makefile for storage/buffer
|
# Makefile for storage/buffer
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.5 1997/12/20 00:27:09 scrappy Exp $
|
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.6 1997/12/30 04:01:25 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ INCLUDE_OPT = -I../..
|
|||||||
|
|
||||||
CFLAGS+=$(INCLUDE_OPT)
|
CFLAGS+=$(INCLUDE_OPT)
|
||||||
|
|
||||||
OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o
|
OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o s_lock.o
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
|
||||||
@ -31,4 +31,3 @@ clean:
|
|||||||
ifeq (depend,$(wildcard depend))
|
ifeq (depend,$(wildcard depend))
|
||||||
include depend
|
include depend
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.13 1997/12/09 20:55:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.14 1997/12/30 04:01:28 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -313,28 +313,9 @@ tas_dummy()
|
|||||||
|
|
||||||
#if defined(__alpha__) && defined(linux)
|
#if defined(__alpha__) && defined(linux)
|
||||||
|
|
||||||
#define S_LOCK(lock) do { \
|
void S_LOCK(slock_t* lock);
|
||||||
slock_t _res; \
|
|
||||||
do { \
|
|
||||||
__asm__(" ldq $0, %0 \n\
|
|
||||||
bne $0, already_set%= \n\
|
|
||||||
ldq_l $0, %0 \n\
|
|
||||||
bne $0, already_set%= \n\
|
|
||||||
or $31, 1, $0 \n\
|
|
||||||
stq_c $0, %0 \n\
|
|
||||||
beq $0, stqc_fail%= \n\
|
|
||||||
success%=: \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"); \
|
|
||||||
} while (_res != 0); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
|
#define S_UNLOCK(lock) { __asm__("mb"); *(lock) = 0; }
|
||||||
#define S_UNLOCK(lock) ({ __asm__("mb \n"); *(lock) = 0; })
|
|
||||||
|
|
||||||
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
|
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user