]> 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 77efbfaef7145c665745e3f21ebc84fee5fcc086..e63831e059c223a084c38b3c4344c83ac6f8f2fa 100644 (file)
@@ -3,7 +3,7 @@
   functions, and CPU architecture-specific functions.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
-Portions Copyright (c) 2008-2009 Apple Inc.<BR>
+Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<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
@@ -126,26 +126,26 @@ typedef struct {
 \r
 #endif // defined (MDE_CPU_EBC)\r
 \r
-#if defined (MDE_CPU_ARM)
-
-typedef struct {
-       UINT32          R3;  ///< Copy of R13
-       UINT32          R4;
-       UINT32          R5;
-       UINT32          R6;
-       UINT32          R7;
-       UINT32          R8;
-       UINT32          R9;
-       UINT32          R10;
-       UINT32          R11;
-       UINT32          R12;
-       UINT32          R14;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
-
-#endif  // defined (MDE_CPU_ARM)
-
+#if defined (MDE_CPU_ARM)\r
+\r
+typedef struct {\r
+  UINT32    R3;  ///< Copy of R13\r
+  UINT32    R4;\r
+  UINT32    R5;\r
+  UINT32    R6;\r
+  UINT32    R7;\r
+  UINT32    R8;\r
+  UINT32    R9;\r
+  UINT32    R10;\r
+  UINT32    R11;\r
+  UINT32    R12;\r
+  UINT32    R14;\r
+} BASE_LIBRARY_JUMP_BUFFER;\r
+\r
+#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4\r
+\r
+#endif  // defined (MDE_CPU_ARM)\r
+\r
 //\r
 // String Services\r
 //\r
@@ -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