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

Commitfadcb01

Browse files
committed
TAS code originally written for s390 (32-bit) does not work for s390x
(64-bit). Fix it. Per report from Permaine Cheung.
1 parented24f28 commitfadcb01

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

‎src/include/storage/s_lock.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
6464
* Portions Copyright (c) 1994, Regents of the University of California
6565
*
66-
* $Id: s_lock.h,v 1.102 2002/11/10 00:33:43 momjian Exp $
66+
* $Id: s_lock.h,v 1.103 2002/11/22 01:13:16 tgl Exp $
6767
*
6868
*-------------------------------------------------------------------------
6969
*/
@@ -150,7 +150,8 @@ tas(volatile slock_t *lock)
150150

151151
#endif/* __arm__ */
152152

153-
#if defined(__s390__)|| defined(__s390x__)
153+
154+
#if defined(__s390__)&& !defined(__s390x__)
154155
/*
155156
* S/390 Linux
156157
*/
@@ -176,6 +177,32 @@ tas(volatile slock_t *lock)
176177

177178
#endif/* __s390__ */
178179

180+
#if defined(__s390x__)
181+
/*
182+
* S/390x Linux (64-bit zSeries)
183+
*/
184+
#defineTAS(lock) tas(lock)
185+
186+
static __inline__int
187+
tas(volatileslock_t*lock)
188+
{
189+
int_res;
190+
191+
__asm____volatile__(
192+
"la1,1\n"
193+
"lg 2,%2\n"
194+
"slr 0,0\n"
195+
"cs 0,1,0(2)\n"
196+
"lr %1,0\n"
197+
:"=m"(lock),"=d"(_res)
198+
:"m"(lock)
199+
:"0","1","2");
200+
201+
return (_res);
202+
}
203+
204+
#endif/* __s390x__ */
205+
179206

180207
#if defined(__sparc__)
181208
#defineTAS(lock) tas(lock)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp