aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-02-14 16:01:43 +0000
committerMichael Brown <mcb30@ipxe.org>2024-02-14 16:25:21 +0000
commit88b291d647686ac686a5614fdd7be92b48747360 (patch)
treea480bfc224f2b43b02bd588becaa1ce424987eef /src/include/ipxe
parent94b39fbe9298160b034c93ca06deb39a907e3b3f (diff)
downloadipxe-88b291d647686ac686a5614fdd7be92b48747360.zip
ipxe-88b291d647686ac686a5614fdd7be92b48747360.tar.gz
ipxe-88b291d647686ac686a5614fdd7be92b48747360.tar.bz2
[list] Add list_is_head_entry()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/ipxe/list.h b/src/include/ipxe/list.h
index 8de2549..53edfc9 100644
--- a/src/include/ipxe/list.h
+++ b/src/include/ipxe/list.h
@@ -399,6 +399,17 @@ extern void extern_list_splice_tail_init ( struct list_head *list,
( (head)->prev == &(entry)->member )
/**
+ * Test if entry is the list head
+ *
+ * @v entry List entry
+ * @v head List head
+ * @v member Name of list field within iterator's type
+ * @ret is_head Entry is the list head
+ */
+#define list_is_head_entry( entry, head, member ) \
+ ( (head) == &(entry)->member )
+
+/**
* Iterate over a list
*
* @v pos Iterator