From: Keir Fraser Date: Fri, 18 Jul 2008 14:44:39 +0000 (+0100) Subject: mini-os is missing list_top in its list.h X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14171^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93a9aafe96ecb28c4271adb1e227a49c343f1574;p=xen.git mini-os is missing list_top in its list.h Signed-off-by: Keir Fraser --- diff --git a/extras/mini-os/include/list.h b/extras/mini-os/include/list.h index 33a6d80f29..fbb1fa8cc0 100644 --- a/extras/mini-os/include/list.h +++ b/extras/mini-os/include/list.h @@ -24,6 +24,12 @@ struct list_head { (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. *