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 new copyright and license
[palacios.git] / palacios / include / palacios / vmm_list.h
index 9fcf799..d66d4c7 100644 (file)
@@ -1,11 +1,24 @@
+/* Stolen From Linux list implementation */
+/* 2008, Modifications by Jack Lange <jarusl@cs.northwestern.edu> */
+
+
 #ifndef _VMM_LIST_H
 #define _VMM_LIST_H
 
+
+#ifdef __V3VEE__
+
 #include <palacios/vmm_string.h>
 
 #undef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 
+
+#define container_of(ptr, type, member) ({                      \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
+
 static inline void prefetch(const void *x) {;}
 
 /*
@@ -519,4 +532,7 @@ static inline void hlist_add_after(struct hlist_node *n,
             pos = n)
 
 
+
+#endif // ! __V3VEE__
+
 #endif