summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-21 21:57:11 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-21 21:57:11 +0000
commitcbca8de5884ff62614e78076dffc093e8373e492 (patch)
tree16a23e59ba8f2cc5e77e77e5011795076fd2f1ae /MdePkg/Include
parente1da91ad12f5320363cdb895a387107c5552c892 (diff)
downloadedk2-cbca8de5884ff62614e78076dffc093e8373e492.zip
edk2-cbca8de5884ff62614e78076dffc093e8373e492.tar.gz
edk2-cbca8de5884ff62614e78076dffc093e8373e492.tar.bz2
1) Add new BaseLib API GetPreviousNode()
2) Clarify comment for the value returned from GetNextNode() if the end of list is reached. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9464 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/BaseLib.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 05014a3..e63831e 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -1383,8 +1383,7 @@ GetFirstNode (
@param List A pointer to the head node of a doubly linked list.
@param Node A pointer to a node in the doubly linked list.
- @return Pointer to the next node if one exists. Otherwise a null value which
- is actually List is returned.
+ @return Pointer to the next node if one exists. Otherwise List is returned.
**/
LIST_ENTRY *
@@ -1394,7 +1393,36 @@ GetNextNode (
IN CONST LIST_ENTRY *Node
);
+
+/**
+ Retrieves the previous node of a doubly linked list.
+
+ Returns the node of a doubly linked list that precedes Node.
+ List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
+ or InitializeListHead(). If List is empty, then List is returned.
+
+ If List is NULL, then ASSERT().
+ If Node is NULL, then ASSERT().
+ If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
+ InitializeListHead(), then ASSERT().
+ If PcdMaximumLinkedListLenth is not zero, and List contains more than
+ PcdMaximumLinkedListLenth nodes, then ASSERT().
+ If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
+
+ @param List A pointer to the head node of a doubly linked list.
+ @param Node A pointer to a node in the doubly linked list.
+
+ @return Pointer to the previous node if one exists. Otherwise List is returned.
+
+**/
+LIST_ENTRY *
+EFIAPI
+GetPreviousNode (
+ IN CONST LIST_ENTRY *List,
+ IN CONST LIST_ENTRY *Node
+ );
+
/**
Checks to see if a doubly linked list is empty or not.