+/* 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)
-static inline void prefetch(const void *x) {;}
+
+#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) {const void * foo; foo = x;}
/*
* These are non-NULL pointers that will result in page faults
pos = n)
+
+#endif // ! __V3VEE__
+
#endif