- @param Value The 8-bit BCD value to convert to an 8-bit value.\r
-\r
- @return The 8-bit value is returned.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BcdToDecimal8 (\r
- IN UINT8 Value\r
- );\r
-\r
-\r
-//\r
-// Linked List Functions and Macros\r
-//\r
-\r
-/**\r
- Initializes the head node of a doubly linked list that is declared as a\r
- global variable in a module.\r
-\r
- Initializes the forward and backward links of a new linked list. After\r
- initializing a linked list with this macro, the other linked list functions\r
- may be used to add and remove nodes from the linked list. This macro results\r
- in smaller executables by initializing the linked list in the data section,\r
- instead if calling the InitializeListHead() function to perform the\r
- equivalent operation.\r
-\r
- @param ListHead The head note of a list to initialize.\r
-\r
-**/\r
-#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}\r
-\r
-\r
-/**\r
- Initializes the head node of a doubly linked list, and returns the pointer to\r
- the head node of the doubly linked list.\r
-\r
- Initializes the forward and backward links of a new linked list. After\r
- initializing a linked list with this function, the other linked list\r
- functions may be used to add and remove nodes from the linked list. It is up\r
- to the caller of this function to allocate the memory for ListHead.\r
-\r
- If ListHead is NULL, then ASSERT().\r
-\r
- @param ListHead A pointer to the head node of a new doubly linked list.\r
-\r
- @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InitializeListHead (\r
- IN OUT LIST_ENTRY *ListHead\r
- );\r
-\r
-\r
-/**\r
- Adds a node to the beginning of a doubly linked list, and returns the pointer\r
- to the head node of the doubly linked list.\r
-\r
- Adds the node Entry at the beginning of the doubly linked list denoted by\r
- ListHead, and returns ListHead.\r
-\r
- If ListHead is NULL, then ASSERT().\r
- If Entry is NULL, then ASSERT().\r
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
- InitializeListHead(), 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
- equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
- @param ListHead 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
- @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InsertHeadList (\r
- IN OUT LIST_ENTRY *ListHead,\r
- IN OUT LIST_ENTRY *Entry\r
- );\r
-\r
-\r
-/**\r
- Adds a node to the end of a doubly linked list, and returns the pointer to\r
- the head node of the doubly linked list.\r
-\r
- Adds the node Entry to the end of the doubly linked list denoted by ListHead,\r
- and returns ListHead.\r
-\r
- If ListHead is NULL, then ASSERT().\r
- If Entry is NULL, then ASSERT().\r
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
- InitializeListHead(), 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
- equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
- @param ListHead 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
- @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InsertTailList (\r
- IN OUT LIST_ENTRY *ListHead,\r
- IN OUT LIST_ENTRY *Entry\r
- );\r
-\r
-\r
-/**\r
- Retrieves the first node of a doubly linked list.\r
-\r
- Returns the first node of a doubly linked list. List must have been \r
- initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
- If List is empty, then List is returned.\r
-\r
- If List 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 the number of nodes\r
- in List, including the List node, is greater than or equal to\r
- PcdMaximumLinkedListLength, then ASSERT().\r
-\r
- @param List A pointer to the head node of a doubly linked list.\r
-\r
- @return The first node of a doubly linked list.\r
- @retval NULL The list is empty.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-GetFirstNode (\r
- IN CONST LIST_ENTRY *List\r
- );\r
-\r
-\r
-/**\r
- Retrieves the next node of a doubly linked list.\r
-\r
- Returns the node of a doubly linked list that follows 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 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 next node if one exists. Otherwise a null value which\r
- is actually List is returned.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-GetNextNode (\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
- Checks to see if the doubly linked list is empty. If the linked list contains\r
- zero nodes, this function returns TRUE. Otherwise, it returns FALSE.\r
-\r
- If ListHead is NULL, then ASSERT().\r
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
- InitializeListHead(), then ASSERT().\r
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
- 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
-\r
- @retval TRUE The linked list is empty.\r
- @retval FALSE The linked list is not empty.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsListEmpty (\r
- IN CONST LIST_ENTRY *ListHead\r
- );\r
-\r
-\r
-/**\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