Skip to content
Snippets Groups Projects
Commit c0cd32d7 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Add ARM32 support by Andrew McMurry

parent a01dfe71
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment