summaryrefslogtreecommitdiff
path: root/db2/mutex/alpha.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-30 21:51:29 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-30 21:51:29 +0000
commit9a93ac006df5199c4dc03710043d1d77396ff29e (patch)
tree8c244c606079be26347cec0a310693c3f829e530 /db2/mutex/alpha.h
parent0742e50134bfc3db08895c020a940a62e5036cfb (diff)
downloadglibc-9a93ac006df5199c4dc03710043d1d77396ff29e.tar
glibc-9a93ac006df5199c4dc03710043d1d77396ff29e.tar.gz
glibc-9a93ac006df5199c4dc03710043d1d77396ff29e.tar.bz2
glibc-9a93ac006df5199c4dc03710043d1d77396ff29e.zip
Update.
* db2/db_int.h: Change tsl_t type to u_int32_t. * db2/mutex/mutex.c: Allow Alpha mutex definitions. * db2/mutex/alpha.h: New file. * db2/mutex/sparc.gcc: Fix store code for v9. Simplify clear code. * sysdeps/alpha/Makefile [db2]: Set CFLAGS of mutex.c to make spinlocks known. Patches by Richard Henderson.
Diffstat (limited to 'db2/mutex/alpha.h')
-rw-r--r--db2/mutex/alpha.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/db2/mutex/alpha.h b/db2/mutex/alpha.h
new file mode 100644
index 0000000000..ad3afc4544
--- /dev/null
+++ b/db2/mutex/alpha.h
@@ -0,0 +1,26 @@
+/* For alpha, 0 is clear, 1 is set. */
+
+#ifdef __GNUC__
+#define TSL_SET(tsl) ({ \
+ register tsl_t *__l = (tsl); \
+ int __r; \
+ asm volatile( \
+ "1: ldl_l %0,%1\n" \
+ " blbs %0,2f\n" \
+ " mov 1,%0\n" \
+ " stl_c %0,%1\n" \
+ " bne %0,1b\n" \
+ " mb\n" \
+ "2:" \
+ : "=&r"(__r), "=m"(*__l) : "m"(*__l) : "memory"); \
+ __r; \
+})
+#endif
+
+#ifdef __DECC
+#include <alpha/builtins.h>
+#define TSL_SET(tsl) (__LOCK_LONG_RETRY((tsl), 1) != 0)
+#endif
+
+#define TSL_UNSET(tsl) (*(tsl) = 0)
+#define TSL_INIT(tsl) TSL_UNSET(tsl)