From: Bruce Momjian Date: Sat, 18 Dec 2004 22:12:52 +0000 (+0000) Subject: Allow NetBSD, m64k to compile the ASM spinlock code. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=555b6bdb15c5701747826d2b141b616c97f1d55a;p=users%2Fbernd%2Fpostgres.git Allow NetBSD, m64k to compile the ASM spinlock code. R?mi Zara --- diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index 504d80ee1f..da862d0c53 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -136,12 +136,26 @@ s_lock(volatile slock_t *lock, const char *file, int line) #if defined(__m68k__) +/* really means: extern int tas(slock_t* **lock); */ static void -tas_dummy() /* really means: extern int tas(slock_t - * **lock); */ +tas_dummy() { __asm__ __volatile__( - "\ +#if defined(__NetBSD__) && defined(__ELF__) +/* no underscore for label and % for registers */ + "\ +.global tas \n\ +tas: \n\ + movel %sp@(0x4),%a0 \n\ + tas %a0@ \n\ + beq _success \n\ + moveq #-128,%d0 \n\ + rts \n\ +_success: \n\ + moveq #0,%d0 \n\ + rts \n" +#else + "\ .global _tas \n\ _tas: \n\ movel sp@(0x4),a0 \n\ @@ -151,8 +165,9 @@ _tas: \n\ rts \n\ _success: \n\ moveq #0,d0 \n\ - rts \n\ -"); + rts \n" +#endif /* __NetBSD__ && __ELF__ */ +); } #endif /* __m68k__ */