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

Commit58ed123

Browse files
committed
Fix for netbsd locking, from Henry B. Hotz.
1 parente2617c8 commit58ed123

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

‎src/include/port/BSD44_derived.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
#defineUSE_POSIX_TIME
2+
23
#if defined(i386)
34
#defineNEED_I386_TAS_ASM
5+
#defineHAS_TEST_AND_SET
46
#endif
7+
58
#if defined(sparc)
69
#defineNEED_SPARC_TAS_ASM
10+
#defineHAS_TEST_AND_SET
711
#endif
12+
813
#if defined(ns32k)
914
#defineNEED_NS32k_TAS_ASM
15+
#defineHAS_TEST_AND_SET
1016
#endif
17+
18+
#if defined(__m68k__)
1119
#defineHAS_TEST_AND_SET
20+
#endif
21+
1222
#if defined(__mips__)
13-
/* #undef HAS_TEST_AND_SET */
23+
/* #undef HAS_TEST_AND_SET */
1424
#endif
1525
typedefunsignedcharslock_t;

‎src/include/storage/s_lock.h

Lines changed: 30 additions & 1 deletion
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.10 1997/10/03 15:27:18 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.11 1997/10/30 05:24:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -24,6 +24,10 @@
2424
*;
2525
*}
2626
*
27+
*In addition to modifying this file you will need to modify
28+
*the appropriate ...src/include/port/...h file to define
29+
*HAS_TEST_AND_SET for the appropriate circumstances.
30+
*
2731
*If this is not done, POSTGRES will default to using System V
2832
*semaphores (and take a large performance hit -- around 40% of
2933
*its time on a DS5000/240 is spent in semop(3)...).
@@ -228,6 +232,31 @@ tas_dummy()
228232

229233
#endif/* sun3 */
230234

235+
/*
236+
*M68000 ports under NetBSD.
237+
*
238+
*This version should also work on a sun3, but I can't test it.
239+
*Conversely the sun3 version should work under NetBSD/m68k, but
240+
*it doesn't.
241+
*/
242+
#if defined(__NetBSD__)&& defined(__m68k__)
243+
244+
staticvoidS_LOCK(char*lock)
245+
{
246+
asm("
247+
movela6@(8),a0
248+
LOOP:
249+
tasa0@
250+
bmiLOOP
251+
");
252+
}
253+
254+
#defineS_UNLOCK(lock)(*(lock) = 0)
255+
256+
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
257+
258+
#endif/* M68000 && NetBSD */
259+
231260
/*
232261
* sparc machines
233262
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp