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.


added list_tail_entry() accessor function
Jack Lange [Tue, 3 Feb 2009 21:34:20 +0000 (15:34 -0600)]
palacios/include/palacios/vmm_list.h

index 0d8747e..0d5b907 100644 (file)
@@ -233,6 +233,20 @@ static inline void list_splice_init(struct list_head *list,
        container_of(ptr, type, member)
 
 /**
+ * list_entry - get the struct for the tail entry
+ * @ptr:       the list_head head pointer.
+ * @type:      the type of the struct this is embedded in.
+ * @member:    the name of the list_struct within the struct.
+ */
+#define list_tail_entry(head, type, member) ({ \
+      type * tail = NULL;                      \
+      if ((head)->prev != (head)) {                    \
+       tail = list_entry((head)->prev, type, member);  \
+      }                                                        \
+      tail;                                            \
+})
+
+/**
  * list_for_each       -       iterate over a list
  * @pos:       the &struct list_head to use as a loop counter.
  * @head:      the head for your list.