mcs-queue: modifications for compiling
[model-checker-benchmarks.git] / mcs-queue / my_queue.h
index 34c9cbd..80e6958 100644 (file)
@@ -1,6 +1,5 @@
 #define TRUE                           1
 #define FALSE                          0
-#define NULL                           0
 
 #define MAX_NODES                      0xff
 #define MAX_SERIAL                     10000
@@ -8,31 +7,35 @@
 #define MAKE_LONG(lo, hi)              ((hi)<<16)+(lo)
 
 typedef union pointer {
-  struct {
-    volatile unsigned short count;
-    volatile unsigned short ptr;
-  } sep;
-  volatile unsigned long con;
+       struct {
+               volatile unsigned short count;
+               volatile unsigned short ptr;
+       } sep;
+       volatile unsigned long con;
 }pointer_t;
 
 typedef struct node {
-  unsigned value;
-  pointer_t next;
-  unsigned foo[30];
+       unsigned value;
+       pointer_t next;
+       unsigned foo[30];
 } node_t;
 
 typedef struct private {
-  unsigned node;
-  unsigned value;
-  unsigned serial[MAX_SERIAL];
+       unsigned node;
+       unsigned value;
+       unsigned serial[MAX_SERIAL];
 } private_t;
 
 typedef struct shared_mem {
-  pointer_t head;
-  unsigned foo1[31];
-  pointer_t tail;
-  unsigned foo2[31];
-  node_t nodes[MAX_NODES+1];
-  unsigned serial;
+       pointer_t head;
+       unsigned foo1[31];
+       pointer_t tail;
+       unsigned foo2[31];
+       node_t nodes[MAX_NODES+1];
+       unsigned serial;
 } shared_mem_t;
 
+void init_private();
+void init_memory();
+void init_queue();
+unsigned dequeue();