Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit407885e

Browse files
committed
Add comments that Solaris Sun compiler only supports sparc9 ASM,
1 parent0d02ef4 commit407885e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

‎src/backend/port/tas/solaris_sparc.s

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@
1616
.global pg_atomic_cas
1717
pg_atomic_cas:
1818

19+
!"cas" only works on sparcv9 chips,and requies a compiler
20+
! that is targeting sparcv9. It will fail on a compiler
21+
! targeting sparcv8,and of course willnot be understood
22+
! by a sparcv8 CPU. If this fails on existing Solaris
23+
! systems, we need to use a !defined(__sparcv9)test
24+
! to fall back to the old"ldstub"call for sparcv8 compiles.
25+
! gcc continues to use"ldstub" because there is no indication
26+
! which sparc version it is targeting.
27+
!
28+
! There actually is a trick for embedding"cas" for a compiler
29+
! that is targetingsparcv8:
30+
!
31+
!http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/sparc/threads/sparc.il
32+
!
33+
! This might work forsparc8:
34+
! ldstub [%o0],%o1! moves only a byte
35+
1936
cas [%o0],%o2,%o1
2037
mov %o1,%o0
2138
retl

‎src/include/storage/s_lock.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
69-
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.152 2006/04/29 11:55:19 momjian Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.153 2006/05/17 23:57:03 momjian Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -311,6 +311,10 @@ tas(volatile slock_t *lock)
311311
{
312312
registerslock_t_res;
313313

314+
/*
315+
*See comment in /pg/backend/port/tas/solaris_sparc.s for why this
316+
*uses "ldstub", and that file uses "cas".
317+
*/
314318
__asm__ __volatile__(
315319
"ldstub[%2], %0\n"
316320
:"=r"(_res),"+m"(*lock)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp