Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8a0967a

Browse files
committed
bring in alpha/linux s_lock changes
From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
1 parent 3c1332e commit 8a0967a

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

src/backend/storage/buffer/Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for storage/buffer
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.5 1997/12/20 00:27:09 scrappy Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.6 1997/12/30 04:01:25 scrappy Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,7 +15,7 @@ INCLUDE_OPT = -I../..
1515

1616
CFLAGS+=$(INCLUDE_OPT)
1717

18-
OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o
18+
OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o s_lock.o
1919

2020
all: SUBSYS.o
2121

@@ -31,4 +31,3 @@ clean:
3131
ifeq (depend,$(wildcard depend))
3232
include depend
3333
endif
34-

src/include/storage/s_lock.h

+4-23
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.13 1997/12/09 20:55:33 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.14 1997/12/30 04:01:28 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -313,28 +313,9 @@ tas_dummy()
313313

314314
#if defined(__alpha__) && defined(linux)
315315

316-
#define S_LOCK(lock) do { \
317-
slock_t _res; \
318-
do { \
319-
__asm__(" ldq $0, %0 \n\
320-
bne $0, already_set%= \n\
321-
ldq_l $0, %0 \n\
322-
bne $0, already_set%= \n\
323-
or $31, 1, $0 \n\
324-
stq_c $0, %0 \n\
325-
beq $0, stqc_fail%= \n\
326-
success%=: \n\
327-
bis $31, $31, %1 \n\
328-
mb \n\
329-
jmp $31, end%= \n\
330-
stqc_fail%=: or $31, 1, $0 \n\
331-
already_set%=: bis $0, $0, %1 \n\
332-
end%=: nop ": "=m"(*lock), "=r"(_res): :"0"); \
333-
} while (_res != 0); \
334-
} while (0)
335-
336-
337-
#define S_UNLOCK(lock) ({ __asm__("mb \n"); *(lock) = 0; })
316+
void S_LOCK(slock_t* lock);
317+
318+
#define S_UNLOCK(lock) { __asm__("mb"); *(lock) = 0; }
338319

339320
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
340321

0 commit comments

Comments
 (0)