Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel' of newskysaw.cs.northwestern.edu:/home/palacios/palacios into...
[palacios.git] / linux_module / util-queue.h
1 /* 
2  * Queue implementation
3  * Jack Lange 2011
4  */
5
6 #ifndef __PALACIOS_QUEUE_H__
7 #define __PALACIOS_QUEUE_H__
8
9
10
11 #include <linux/list.h>
12 #include <linux/spinlock.h>
13
14
15
16 struct queue_entry {
17     void * entry;
18     struct list_head node;
19 };
20
21
22 struct gen_queue {
23     unsigned int num_entries;
24     unsigned int max_entries;
25     struct list_head entries;
26     spinlock_t lock;
27 };
28
29
30 struct gen_queue * create_queue(unsigned int max_entries);
31 void init_queue(struct gen_queue * queue, unsigned int max_entries);
32
33 int enqueue(struct gen_queue * queue, void * entry);
34 void * dequeue(struct gen_queue * queue);
35
36
37
38
39
40 #endif