X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_list.h;fp=palacios%2Finclude%2Fpalacios%2Fvmm_list.h;h=0d5b907079e7d5d7941bd69ff615d033ec28ea56;hb=5dba37e6d7ff831c2b2239851701a83d21956645;hp=0d8747e9efae39befdf303878a271f7380cbd0f3;hpb=2222a18071be7f4f665206a1bfa274b8f27f4fcc;p=palacios.git diff --git a/palacios/include/palacios/vmm_list.h b/palacios/include/palacios/vmm_list.h index 0d8747e..0d5b907 100644 --- a/palacios/include/palacios/vmm_list.h +++ b/palacios/include/palacios/vmm_list.h @@ -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.