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

Commit15da185

Browse files
committed
From: Phil Nelson <phil@cs.wwu.edu>
Subject: [PATCHES] Added support for NetBSD/pc532.
1 parent355d6a2 commit15da185

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

‎src/backend/storage/ipc/s_lock.c

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.13 1997/04/24 02:35:35 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.14 1997/06/06 01:37:14 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -486,4 +486,40 @@ S_INIT_LOCK(slock_t *lock)
486486

487487
#endif/* defined(linux) && defined(sparc) */
488488

489+
#if defined(NEED_NS32K_TAS_ASM)
490+
491+
int
492+
tas(slock_t*m)
493+
{
494+
slock_tres=0;
495+
__asm__("movd 8(fp), r1");
496+
__asm__("movqd 0, r0");
497+
__asm__("sbitd r0, 0(r1)");
498+
__asm__("sprb us, %0" :"=r" (res));
499+
res= (res >>5)&1;
500+
returnres;
501+
}
502+
503+
void
504+
S_LOCK(slock_t*lock)
505+
{
506+
while (tas(lock))
507+
;
508+
}
509+
510+
void
511+
S_UNLOCK(slock_t*lock)
512+
{
513+
*lock=0;
514+
}
515+
516+
void
517+
S_INIT_LOCK(slock_t*lock)
518+
{
519+
S_UNLOCK(lock);
520+
}
521+
522+
#endif/* NEED_NS32K_TAS_ASM */
523+
524+
489525
#endif/* HAS_TEST_AND_SET */

‎src/include/port/BSD44_derived.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# if defined(sparc)
66
# defineNEED_SPARC_TAS_ASM
77
# endif
8+
# if defined(ns32k)
9+
# defineNEED_NS32k_TAS_ASM
10+
# endif
811
# defineHAS_TEST_AND_SET
912
# if defined(__mips__)
1013
/* # undef HAS_TEST_AND_SET */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp