@param List A pointer to the head node of a doubly linked list.\r
@param Node A pointer to a node in the doubly linked list.\r
\r
- @return Pointer to the next node if one exists. Otherwise a null value which\r
- is actually List is returned.\r
+ @return Pointer to the next node if one exists. Otherwise List is returned.\r
\r
**/\r
LIST_ENTRY *\r
IN CONST LIST_ENTRY *Node\r
);\r
\r
+ \r
+/**\r
+ Retrieves the previous node of a doubly linked list.\r
+ \r
+ Returns the node of a doubly linked list that precedes Node. \r
+ List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
+ or InitializeListHead(). If List is empty, then List is returned.\r
+ \r
+ If List is NULL, then ASSERT().\r
+ If Node is NULL, then ASSERT().\r
+ If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+ InitializeListHead(), then ASSERT().\r
+ If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+ PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+ If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
+ \r
+ @param List A pointer to the head node of a doubly linked list.\r
+ @param Node A pointer to a node in the doubly linked list.\r
+ \r
+ @return Pointer to the previous node if one exists. Otherwise List is returned.\r
+ \r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+GetPreviousNode (\r
+ IN CONST LIST_ENTRY *List,\r
+ IN CONST LIST_ENTRY *Node\r
+ );\r
\r
+ \r
/**\r
Checks to see if a doubly linked list is empty or not.\r
\r
@param List A pointer to the head node of a doubly linked list.\r
@param Node A pointer to a node in the doubly linked list.\r
\r
- @return Pointer to the next node if one exists. Otherwise a null value which\r
- is actually List is returned.\r
+ @return Pointer to the next node if one exists. Otherwise List is returned.\r
\r
**/\r
LIST_ENTRY *\r
return Node->ForwardLink;\r
}\r
\r
+/**\r
+ Retrieves the previous node of a doubly linked list.\r
+ \r
+ Returns the node of a doubly linked list that precedes Node. \r
+ List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
+ or InitializeListHead(). If List is empty, then List is returned.\r
+ \r
+ If List is NULL, then ASSERT().\r
+ If Node is NULL, then ASSERT().\r
+ If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
+ InitializeListHead(), then ASSERT().\r
+ If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+ PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+ If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
+ \r
+ @param List A pointer to the head node of a doubly linked list.\r
+ @param Node A pointer to a node in the doubly linked list.\r
+ \r
+ @return Pointer to the previous node if one exists. Otherwise List is returned.\r
+ \r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+GetPreviousNode (\r
+ IN CONST LIST_ENTRY *List,\r
+ IN CONST LIST_ENTRY *Node\r
+ )\r
+{\r
+ //\r
+ // ASSERT List not too long and Node is one of the nodes of List\r
+ //\r
+ ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE));\r
+ \r
+ return Node->BackLink;\r
+}\r
+\r
/**\r
Checks to see if a doubly linked list is empty or not.\r
\r