5 typedef unsigned long long pointer;
6 typedef atomic_ullong pointer_t;
8 #define MAKE_POINTER(ptr, count) ((((pointer)count) << 32) | ptr)
9 #define PTR_MASK 0xffffffffLL
10 #define COUNT_MASK (0xffffffffLL << 32)
12 static inline void set_count(pointer *p, unsigned int val) { *p = (*p & ~COUNT_MASK) | ((pointer)val << 32); }
13 static inline void set_ptr(pointer *p, unsigned int val) { *p = (*p & ~PTR_MASK) | val; }
14 static inline unsigned int get_count(pointer p) { return p & PTR_MASK; }
15 static inline unsigned int get_ptr(pointer p) { return (p & COUNT_MASK) >> 32; }
22 typedef struct private {
26 typedef struct shared_mem {
29 node_t nodes[MAX_NODES + 1];
32 void init_private(int pid);
33 void init_queue(queue_t *q);
34 void enqueue(queue_t *q, unsigned int val);
35 unsigned int dequeue(queue_t *q);