Add ARM32 support by Andrew McMurry

This commit is contained in:
Bruce Momjian 1999-04-13 17:42:26 +00:00
parent a01dfe71b8
commit c0cd32d7b4
2 changed files with 21 additions and 1 deletions

View File

@ -24,6 +24,10 @@
#define HAS_TEST_AND_SET
#endif
#if defined(__arm32__)
#define HAS_TEST_AND_SET
#endif
#if defined(__powerpc__)
#define HAS_TEST_AND_SET
typedef unsigned int slock_t;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.58 1999/02/13 23:22:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.59 1999/04/13 17:42:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -124,6 +124,22 @@ __asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res));
#if defined(__arm32__)
#define TAS(lock) tas(lock)
static __inline__ int
tas(volatile slock_t *lock)
{
register slock_t _res = 1;
__asm__("swpb %0, %0, [%3]": "=r"(_res), "=m"(*lock):"0"(_res), "r" (lock));
return (int) _res;
}
#endif /* __arm32__ */
#if defined(sparc)
#define TAS(lock) tas(lock)