about summary refs log tree commit diff
path: root/db2/mutex/alpha.dec
diff options
context:
space:
mode:
Diffstat (limited to 'db2/mutex/alpha.dec')
-rw-r--r--db2/mutex/alpha.dec25
1 files changed, 25 insertions, 0 deletions
diff --git a/db2/mutex/alpha.dec b/db2/mutex/alpha.dec
new file mode 100644
index 0000000000..83ed371136
--- /dev/null
+++ b/db2/mutex/alpha.dec
@@ -0,0 +1,25 @@
+/*
+ * @(#)alpha.dec	8.3 (Sleepycat Software) 1/18/97
+ *
+ * The DEC C asm acts as a pseudo-call.  The first argument is the assembly
+ * code, and the remaining arguments are assigned as in a procedure call, to
+ * r16, r17, etc. (represented in asm as %a0, %a1, and so forth).
+ *
+ * From: Dave Butenhof.
+ */
+
+#include <c_asm.h>
+
+#define	TSL_SET(tsl)	(asm ("mb;					\
+    10:	ldl_l	%v0,(%a0) ;						\
+	bne	%v0,30f ;						\
+	or	%v0,1,%r1 ;						\
+	stl_c	%r1,(%a0) ;						\
+	beq	%r1,20f ;						\
+	mb	;							\
+	br	%r31,30f ;						\
+    20:	br	%r31,10b ;						\
+    30:	", (tsl)))
+
+THIS WAS NOT CONVERTED TO TAKE A POINTER AS AN ARGUMENT...
+#define	TSL_UNSET(tsl)	(asm ("mb"), *(tsl) = 0)