+2003-02-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * hppa/atomicity.h (__Atomicity_lock<__inst>::_S_atomicity_lock):
+ Correct alignment.
+ (__exchange_and_add, __atomic_add): Use PA 2.0 ordered store to reset
+ lock.
+
2003-02-07 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/filebuf_virtuals.cc (test08): Fix for
template <int __inst>
struct __Atomicity_lock
{
- static volatile int __attribute__ ((aligned (16))) _S_atomicity_lock;
+ static volatile int _S_atomicity_lock;
};
template <int __inst>
-volatile int __Atomicity_lock<__inst>::_S_atomicity_lock = 1;
+volatile int
+__Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
/* Because of the lack of weak support when using the hpux
som linker, we explicitly instantiate the atomicity lock
result = *__mem;
*__mem = result + __val;
- __asm__ __volatile__("");
- lock = tmp;
+ /* Reset lock with PA 2.0 "ordered" store. */
+ __asm__ __volatile__ ("stw,ma %1,0(%0)"
+ : : "r" (&lock), "r" (tmp) : "memory");
return result;
}
: "r" (&lock));
*__mem += __val;
- __asm__ __volatile__("");
- lock = tmp;
+ /* Reset lock with PA 2.0 "ordered" store. */
+ __asm__ __volatile__ ("stw,ma %1,0(%0)"
+ : : "r" (&lock), "r" (tmp) : "memory");
}
#endif