]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/LinkedList.c
Modify MDE source code according to MDE library update.
[mirror_edk2.git] / MdePkg / Library / BaseLib / LinkedList.c
index 8190ca345ccdf7340f31bc957717416d06681689..6f0d5c9534cb1855b8b98ec87ff662338477c3dc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Linked List Library Functions.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -12,9 +12,7 @@
 \r
 **/\r
 \r
-//\r
-// Include common header file for this module.\r
-//\r
+\r
 \r
 \r
 #include "BaseLibInternals.h"\r
@@ -27,7 +25,7 @@
 \r
   If List is NULL, then ASSERT().\r
   If List->ForwardLink is NULL, then ASSERT().\r
-  If List->backLink is NULL, then ASSERT().\r
+  If List->BackLink is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT();\r
   If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
   of nodes in ListHead, including the ListHead node, is greater than or\r
@@ -41,6 +39,7 @@
 \r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 IsNodeInList (\r
   IN      CONST LIST_ENTRY      *List,\r
   IN      CONST LIST_ENTRY      *Node\r
@@ -89,7 +88,7 @@ IsNodeInList (
 \r
   If ListHead is NULL, then ASSERT().\r
 \r
-  @param  ListHead  A pointer to the head node of a new doubly linked list.\r
+  @param  List  A pointer to the head node of a new doubly linked list.\r
 \r
   @return ListHead\r
 \r
@@ -122,7 +121,7 @@ InitializeListHead (
   of nodes in ListHead, including the ListHead node, is greater than or\r
   equal to PcdMaximumLinkedListLength, then ASSERT().\r
 \r
-  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+  @param  List      A pointer to the head node of a doubly linked list.\r
   @param  Entry     A pointer to a node that is to be inserted at the beginning\r
                     of a doubly linked list.\r
 \r
@@ -162,7 +161,7 @@ InsertHeadList (
   of nodes in ListHead, including the ListHead node, is greater than or\r
   equal to PcdMaximumLinkedListLength, then ASSERT().\r
 \r
-  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+  @param  List      A pointer to the head node of a doubly linked list.\r
   @param  Entry     A pointer to a node that is to be added at the end of the\r
                     doubly linked list.\r
 \r
@@ -269,7 +268,7 @@ GetNextNode (
   in List, including the List node, is greater than or equal to\r
   PcdMaximumLinkedListLength, then ASSERT().\r
 \r
-  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+  @param  List  A pointer to the head node of a doubly linked list.\r
 \r
   @retval TRUE  The linked list is empty.\r
   @retval FALSE The linked list is not empty.\r
@@ -290,11 +289,13 @@ IsListEmpty (
 }\r
 \r
 /**\r
-  Determines if a node in a doubly linked list is null.\r
+  Determines if a node in a doubly linked list is the head node of a the same\r
+  doubly linked list.  This function is typically used to terminate a loop that\r
+  traverses all the nodes in a doubly linked list starting with the head node.\r
 \r
-  Returns FALSE if Node is one of the nodes in the doubly linked list specified\r
-  by List. Otherwise, TRUE is returned. List must have been initialized with\r
-  InitializeListHead().\r
+  Returns TRUE if Node is equal to List.  Returns FALSE if Node is one of the\r
+  nodes in the doubly linked list specified by List.  List must have been\r
+  initialized with InitializeListHead().\r
 \r
   If List is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT().\r
@@ -384,6 +385,8 @@ IsNodeAtEnd (
 \r
   @param  FirstEntry  A pointer to a node in a linked list.\r
   @param  SecondEntry A pointer to another node in the same linked list.\r
+  \r
+  @return SecondEntry after the nodes are swapped\r
 \r
 **/\r
 LIST_ENTRY *\r
@@ -410,7 +413,7 @@ SwapListEntries (
   Ptr = RemoveEntryList (FirstEntry);\r
 \r
   //\r
-  // If FirstEntry immediately follows SecondEntry, FirstEntry willl be placed\r
+  // If FirstEntry immediately follows SecondEntry, FirstEntry will be placed\r
   // immediately in front of SecondEntry\r
   //\r
   if (Ptr->BackLink == SecondEntry) {\r
@@ -451,7 +454,9 @@ SwapListEntries (
 \r
   @param  Entry A pointer to a node in a linked list\r
 \r
-  @return Entry\r
+  @return The node following Entry in the doubly linked list.\r
+          If Entry is the only node in the linked list, then\r
+          the head node of the linked list is returned.\r
 \r
 **/\r
 LIST_ENTRY *\r