-/* Stolen From Linux list implementation */
+/* Taken From Linux list implementation
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
/* 2008, Modifications by Jack Lange <jarusl@cs.northwestern.edu> */
+
#ifndef _VMM_LIST_H
#define _VMM_LIST_H
+/**
+ * list_next_entry -- get the struct for the next entry in a list
+ * @ptr: current list entry
+ * @type: type of the struct this is embedded in
+ * @member: name of the list struct within the struct
+ */
+#define list_next_entry(node, type, member) \
+ ({ \
+ type * next = NULL; \
+ if ((node)->next != (node)) { \
+ next = list_entry((node)->next, type, member); \
+ } \
+ next; \
+ })
+
/**
* list_for_each - iterate over a list