From: Mark Andrews Date: Wed, 9 Jan 2013 01:55:32 +0000 (+1100) Subject: 3454. [port] sparc64: improve atomic support. [RT #25182] X-Git-Tag: v9.10.0a1~606 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa24128022b85c49f59ad45a3c81ad124d645530;p=thirdparty%2Fbind9.git 3454. [port] sparc64: improve atomic support. [RT #25182] --- diff --git a/CHANGES b/CHANGES index 3ddca186099..2d70584746f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3454. [port] sparc64: improve atomic support. [RT #25182] + 3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;' failed. [RT #31960] diff --git a/lib/isc/sparc64/include/isc/atomic.h b/lib/isc/sparc64/include/isc/atomic.h index 5533ddb0cc6..e323e05ce1b 100644 --- a/lib/isc/sparc64/include/isc/atomic.h +++ b/lib/isc/sparc64/include/isc/atomic.h @@ -72,9 +72,9 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(swapped) - : "r"(p), "n"(ASI_P), "r"(prev)); + "casa [%2] %3, %4, %0" + : "+r"(swapped), "=m"(*p) + : "r"(p), "n"(ASI_P), "r"(prev), "m"(*p)); if (swapped == prev) break; } @@ -92,10 +92,9 @@ isc_atomic_store(isc_int32_t *p, isc_int32_t val) { for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = val; __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(swapped) - : "r"(p), "n"(ASI_P), "r"(prev) - : "memory"); + "casa [%2] %3, %4, %0" + : "+r"(swapped), "=m"(*p) + : "r"(p), "n"(ASI_P), "r"(prev), "m"(*p)); if (swapped == prev) break; } @@ -111,9 +110,9 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { isc_int32_t temp = val; __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(temp) - : "r"(p), "n"(ASI_P), "r"(cmpval)); + "casa [%2] %3, %4, %0" + : "+r"(temp), "=m"(*p) + : "r"(p), "n"(ASI_P), "r"(cmpval), "m"(*p)); return (temp); }