]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
1) Add new BaseLib API GetPreviousNode()
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index 05014a3b6d79f4cbfdbf5c9edd83a7c610a3f3fe..e63831e059c223a084c38b3c4344c83ac6f8f2fa 100644 (file)
@@ -1383,8 +1383,7 @@ GetFirstNode (
   @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
@@ -1394,7 +1393,36 @@ GetNextNode (
   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