The LOCK prefix should not have been defined away, its absence
authorbdemsky <bdemsky>
Thu, 29 Jan 2009 22:28:30 +0000 (22:28 +0000)
committerbdemsky <bdemsky>
Thu, 29 Jan 2009 22:28:30 +0000 (22:28 +0000)
completely breaks the readwrite locks.  This was the reason for
benchmarks that get stuck.

Robust/src/Runtime/DSTM/interface/dsmlock.h

index 596b7296873f170a1c8c6ad7550ff7a64d440338..7e10dc38ba844e09c2154ec2ee3cf93e06fb1576 100644 (file)
@@ -4,10 +4,18 @@
 #define RW_LOCK_BIAS             0x01000000
 #define atomic_read(v)          ((v)->counter)
 #define RW_LOCK_UNLOCKED          { RW_LOCK_BIAS }
-#define LOCK_PREFIX ""
+//#define LOCK_PREFIX ""
+#define LOCK_PREFIX \
+                ".section .smp_locks,\"a\"\n"   \
+                "  .align 4\n"                  \
+                "  .long 661f\n" /* address */  \
+                ".previous\n"                   \
+                "661:\n\tlock; "
+
+
 
 typedef struct {
-  int counter;
+  unsigned int counter;
 } atomic_t;
 
 void initdsmlocks(volatile unsigned int *addr);