X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_list.h;h=22f447c9e5de81a4fd34bf945c2b3f14aae4eddc;hb=8e9c13c41b0244a8d0029e837a623591a22c5879;hp=f44933af52685a406e65b8130e4e520d1ccde6bc;hpb=0121a4503305424096e2b5c5bd3b6c3af2d813e5;p=palacios.git diff --git a/palacios/include/palacios/vmm_list.h b/palacios/include/palacios/vmm_list.h index f44933a..22f447c 100644 --- a/palacios/include/palacios/vmm_list.h +++ b/palacios/include/palacios/vmm_list.h @@ -1,7 +1,24 @@ -/* 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 */ + #ifndef _VMM_LIST_H #define _VMM_LIST_H @@ -263,6 +280,21 @@ static inline void list_splice_init(struct list_head *list, +/** + * 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