\r
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
**/\r
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}\r
\r
+/**\r
+ Iterates over each node in a doubly linked list using each node's forward link.\r
+\r
+ @param Entry A pointer to a list node used as a loop cursor during iteration\r
+ @param ListHead The head node of the doubly linked list\r
+\r
+**/\r
+#define BASE_LIST_FOR_EACH(Entry, ListHead) \\r
+ for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)\r
+\r
+/**\r
+ Iterates over each node in a doubly linked list using each node's forward link\r
+ with safety against node removal.\r
+\r
+ This macro uses NextEntry to temporarily store the next list node so the node\r
+ pointed to by Entry may be deleted in the current loop iteration step and\r
+ iteration can continue from the node pointed to by NextEntry.\r
+\r
+ @param Entry A pointer to a list node used as a loop cursor during iteration\r
+ @param NextEntry A pointer to a list node used to temporarily store the next node\r
+ @param ListHead The head node of the doubly linked list\r
+\r
+**/\r
+#define BASE_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \\r
+ for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\\r
+ Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)\r
\r
/**\r
Checks whether FirstEntry and SecondEntry are part of the same doubly-linked\r