ia64/xen-unstable

changeset 18110:60828077e175

mini-os is missing list_top in its list.h

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 18 15:44:39 2008 +0100 (2008-07-18)
parents 092a15aa2430
children d85714c0a742
files extras/mini-os/include/list.h
line diff
     1.1 --- a/extras/mini-os/include/list.h	Fri Jul 18 15:03:55 2008 +0100
     1.2 +++ b/extras/mini-os/include/list.h	Fri Jul 18 15:44:39 2008 +0100
     1.3 @@ -24,6 +24,12 @@ struct list_head {
     1.4  	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
     1.5  } while (0)
     1.6  
     1.7 +#define list_top(head, type, member)					  \
     1.8 +({ 									  \
     1.9 +	struct list_head *_head = (head);				  \
    1.10 +	list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
    1.11 +})
    1.12 +
    1.13  /*
    1.14   * Insert a new entry between two known consecutive entries. 
    1.15   *