提交 8a0967a3 编写于 作者: M Marc G. Fournier

bring in alpha/linux s_lock changes

From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
上级 3c1332e5
...@@ -4,7 +4,7 @@ ...@@ -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../.. ...@@ -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: ...@@ -31,4 +31,3 @@ clean:
ifeq (depend,$(wildcard depend)) ifeq (depend,$(wildcard depend))
include depend include depend
endif endif
...@@ -7,7 +7,7 @@ ...@@ -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() ...@@ -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 { \ #define S_UNLOCK(lock) { __asm__("mb"); *(lock) = 0; }
__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 \n"); *(lock) = 0; })
#define S_INIT_LOCK(lock) S_UNLOCK(lock) #define S_INIT_LOCK(lock) S_UNLOCK(lock)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册