diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-12-30 21:43:41 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-12-30 21:43:41 +0000 |
commit | 12af9cdff485fd2c76630ba85e8437e5ee51558c (patch) | |
tree | 1652c3bb7bd61408c5392ef56fa7167e69b3d403 /src/backend | |
parent | c876d965f5e7a8b300f57d21de570cca291ac84a (diff) | |
download | postgresql-12af9cdff485fd2c76630ba85e8437e5ee51558c.tar.gz postgresql-12af9cdff485fd2c76630ba85e8437e5ee51558c.zip |
Add support for Solaris x86_64 using Sun's compiler.
Pierre Girard
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/port/tas/solaris_x86_64.s | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/backend/port/tas/solaris_x86_64.s b/src/backend/port/tas/solaris_x86_64.s new file mode 100644 index 00000000000..4fad43e5a2a --- /dev/null +++ b/src/backend/port/tas/solaris_x86_64.s @@ -0,0 +1,35 @@ +/============================================================================= +/ tas.s -- test and set lock for solaris_i386 +/ based on i386 ASM with modifications outlined in +/ http://www.x86-64.org/documentation/assembly +/============================================================================= + + .file "tas.s" + .text + .align 16 +.L1.text: + + .globl tas +tas: + pushq %rbp /save prev base pointer + movq %rsp,%rbp /new base pointer + pushq %rbx /save prev bx + movq 8(%rbp),%rbx /load bx with address of lock + movq $255,%rax /put something in ax + xchgb %al,(%rbx) /swap lock value with "0" + cmpb $0,%al /did we get the lock? + jne .Locked + subq %rax,%rax /yes, we got it -- return 0 + jmp .Finish + .align 8 +.Locked: + movq $1,%rax /no, we didn't get it - return 1 +.Finish: + popq %rbx /restore prev bx + movq %rbp,%rsp /restore stack state + popq %rbp + ret /return + .align 8 + .type tas,@function + .size tas,.-tas + |