This commit was generated by cvs2svn to compensate for changes in r174206,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Doug Barton 2007-12-03 08:26:34 +00:00
commit 1061ff7e54
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174207

View file

@ -49,7 +49,29 @@ isc_atomic_store(isc_int32_t *p, isc_int32_t val)
static inline isc_int32_t
isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val)
{
return atomic_cmpset_int(p, cmpval, val);
register int done, ras_start;
__asm __volatile("1:\n"
"adr %1, 1b\n"
"mov %0, #0xe0000004\n"
"str %1, [%0]\n"
"mov %0, #0xe0000008\n"
"adr %1, 2f\n"
"str %1, [%0]\n"
"ldr %1, [%2]\n"
"cmp %1, %3\n"
"streq %4, [%2]\n"
"2:\n"
"mov %3, #0\n"
"mov %0, #0xe0000004\n"
"str %3, [%0]\n"
"mov %3, #0xffffffff\n"
"mov %0, #0xe0000008\n"
"str %3, [%0]\n"
: "=r" (ras_start), "=r" (done)
,"+r" (p), "+r" (cmpval), "+r" (val) : : "memory");
return (done);
}
#else /* !FreeBSD */