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

Commit731ea80

Browse files
committed
Here's the new diff for getting the NS32K assembly code into thespin-locks. Notice that it's now inline assembler in s_lock.h,rather than seperate code in s_lock.c. It also shrank a littlebit... Just rip out the S_LOCK() define and insert the tas() inlinefunction. Please let me know if there are any problems with it.Jon Buller
1 parent744c3cd commit731ea80

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

‎src/include/storage/s_lock.h

Lines changed: 17 additions & 19 deletions
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.51 1998/10/01 01:53:50 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.52 1998/10/02 15:23:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -168,6 +168,22 @@ tas(volatile slock_t *lock)
168168

169169

170170

171+
#if defined(NEED_NS32K_TAS_ASM)
172+
#defineTAS(lock) tas(lock)
173+
174+
static __inline__int
175+
tas(volatileslock_t*lock)
176+
{
177+
register_res;
178+
__asm__("sbitb 0, %0
179+
sfsd %1"
180+
:"=m"(*lock),"=r"(_res));
181+
return (int)_res;
182+
}
183+
184+
#endif/* NEED_NS32K_TAS_ASM */
185+
186+
171187

172188
#else/* __GNUC__ */
173189
/***************************************************************************
@@ -212,24 +228,6 @@ tas(slock_t *s_lock)
212228

213229
#endif/* NEED_I386_TAS_ASM */
214230

215-
216-
217-
#if defined(NEED_NS32K_TAS_ASM)
218-
219-
#defineS_LOCK(lock)\
220-
{\
221-
slock_t res = 1;\
222-
while (res) {\
223-
__asm__("movqd 0, r0");\
224-
__asm__("sbitd r0, %0" : "=m"(*lock));\
225-
__asm__("sprb us, %0" : "=r" (res));\
226-
res = ((res >> 5) & 1);\
227-
}\
228-
}
229-
230-
#endif/* NEED_NS32K_TAS_ASM */
231-
232-
233231
#endif/* defined(__GNUC__) */
234232

235233

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp