File tree 2 files changed +37
-2
lines changed
src/backend/port/i386_solaris
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 7
7
#
8
8
#
9
9
# IDENTIFICATION
10
- # $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/Makefile.inc,v 1.3 1996/07/25 07:27:08 scrappy Exp $
10
+ # $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/Makefile.inc,v 1.4 1996/07/25 19:48:24 scrappy Exp $
11
11
#
12
12
# -------------------------------------------------------------------------
13
13
14
14
CFLAGS+ = -DUSE_POSIX_TIME -DNEED_ISINF -DNEED_RUSAGE -DNO_EMPTY_STMTS
15
15
16
16
LDADD+ = -ll -ldl
17
17
18
- SUBSRCS+ = port.c
18
+ SUBSRCS+ = port.c tas.s
19
19
20
20
HEADERS+ = machine.h port-protos.h rusagestub.h
Original file line number Diff line number Diff line change
1
+ /=============================================================================
2
+ / tas.s -- test and set lock for i386_solaris
3
+ /=============================================================================
4
+
5
+ .file "tas.s"
6
+ .text
7
+ .align 16
8
+ .L1.text:
9
+
10
+ .globl tas
11
+ tas:
12
+ pushl %ebp /save prev base pointer
13
+ movl %esp ,%ebp /new base pointer
14
+ pushl %ebx /save prev bx
15
+ movl 8 (%ebp ),%ebx /load bx with address of lock
16
+ pushl %ebx /save prev bx
17
+ movl 8 (%ebp ),%ebx /load bx with address of lock
18
+ movl $255 ,%eax /put something in ax
19
+ xchgb %al ,(%ebx ) /swap lock value with "0"
20
+ cmpb $0 ,%al /did we get the lock ?
21
+ jne .Locked
22
+ subl %eax ,%eax /yes, we got it -- return 0
23
+ jmp .Finish
24
+ .align 4
25
+ .Locked:
26
+ movl $1 ,%eax /no, we didn't get it - return 1
27
+ .Finish:
28
+ popl %ebx /restore prev bx
29
+ movl %ebp ,%esp /restore stack state
30
+ popl %ebp
31
+ ret /return
32
+ .align 4
33
+ .type tas,@function
34
+ .size tas,.-tas
35
+
You can’t perform that action at this time.
0 commit comments