From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Ongaro Subject: [PATCH] missing mini-os list_top macro Date: Fri, 18 Jul 2008 15:18:19 +0100 Message-ID: <4880A62B.3050205@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org mini-os is missing list_top in its list.h --- diff -r 37289395de03 extras/mini-os/include/list.h --- a/extras/mini-os/include/list.h Fri Jul 18 14:20:13 2008 +0100 +++ b/extras/mini-os/include/list.h Fri Jul 18 15:05:42 2008 +0100 @@ -23,6 +23,12 @@ #define INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) + +#define list_top(head, type, member) \ +({ \ + struct list_head *_head = (head); \ + list_empty(_head) ? NULL : list_entry(_head->next, type, member); \ +}) /* * Insert a new entry between two known consecutive entries.