Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08690d0

Browse files
committed
Allow NetBSD, m64k to compile the ASM spinlock code.
R?mi Zara
1 parent afc4ffe commit 08690d0

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

src/backend/storage/lmgr/s_lock.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.32 2004/08/30 23:47:20 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.33 2004/12/18 22:12:52 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -136,12 +136,26 @@ s_lock(volatile slock_t *lock, const char *file, int line)
136136

137137

138138
#if defined(__m68k__)
139+
/* really means: extern int tas(slock_t* **lock); */
139140
static void
140-
tas_dummy() /* really means: extern int tas(slock_t
141-
* **lock); */
141+
tas_dummy()
142142
{
143143
__asm__ __volatile__(
144-
"\
144+
#if defined(__NetBSD__) && defined(__ELF__)
145+
/* no underscore for label and % for registers */
146+
"\
147+
.global tas \n\
148+
tas: \n\
149+
movel %sp@(0x4),%a0 \n\
150+
tas %a0@ \n\
151+
beq _success \n\
152+
moveq #-128,%d0 \n\
153+
rts \n\
154+
_success: \n\
155+
moveq #0,%d0 \n\
156+
rts \n"
157+
#else
158+
"\
145159
.global _tas \n\
146160
_tas: \n\
147161
movel sp@(0x4),a0 \n\
@@ -151,8 +165,9 @@ _tas: \n\
151165
rts \n\
152166
_success: \n\
153167
moveq #0,d0 \n\
154-
rts \n\
155-
");
168+
rts \n"
169+
#endif /* __NetBSD__ && __ELF__ */
170+
);
156171
}
157172
#endif /* __m68k__ */
158173

0 commit comments

Comments
 (0)