mirror of https://github.com/acidanthera/audk.git
synchronize the MdePkg/Include/Library/BaseLib.h and the MDE_Library_Spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6560 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9510db651c
commit
17f695ed2b
|
@ -160,9 +160,8 @@ StrCpy (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copies one Null-terminated Unicode string with a maximum length to another
|
Copies up to a specified length from one Null-terminated Unicode string to
|
||||||
Null-terminated Unicode string with a maximum length and returns the new
|
another Null-terminated Unicode string and returns the new Unicode string.
|
||||||
Unicode string.
|
|
||||||
|
|
||||||
This function copies the contents of the Unicode string Source to the Unicode
|
This function copies the contents of the Unicode string Source to the Unicode
|
||||||
string Destination, and returns Destination. At most, Length Unicode
|
string Destination, and returns Destination. At most, Length Unicode
|
||||||
|
@ -225,8 +224,8 @@ StrLen (
|
||||||
Returns the size of a Null-terminated Unicode string in bytes, including the
|
Returns the size of a Null-terminated Unicode string in bytes, including the
|
||||||
Null terminator.
|
Null terminator.
|
||||||
|
|
||||||
This function returns the size, in bytes, of the Null-terminated Unicode
|
This function returns the size, in bytes, of the Null-terminated Unicode string
|
||||||
string specified by String.
|
specified by String.
|
||||||
|
|
||||||
If String is NULL, then ASSERT().
|
If String is NULL, then ASSERT().
|
||||||
If String is not aligned on a 16-bit boundary, then ASSERT().
|
If String is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
@ -283,8 +282,8 @@ StrCmp (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Compares two Null-terminated Unicode strings with maximum lengths, and
|
Compares up to a specified length the contents of two Null-terminated Unicode strings,
|
||||||
returns the difference between the first mismatched Unicode characters.
|
and returns the difference between the first mismatched Unicode characters.
|
||||||
|
|
||||||
This function compares the Null-terminated Unicode string FirstString to the
|
This function compares the Null-terminated Unicode string FirstString to the
|
||||||
Null-terminated Unicode string SecondString. At most, Length Unicode
|
Null-terminated Unicode string SecondString. At most, Length Unicode
|
||||||
|
@ -362,8 +361,8 @@ StrCat (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Concatenates one Null-terminated Unicode string with a maximum length to the
|
Concatenates up to a specified length one Null-terminated Unicode to the end
|
||||||
end of another Null-terminated Unicode string, and returns the concatenated
|
of another Null-terminated Unicode string, and returns the concatenated
|
||||||
Unicode string.
|
Unicode string.
|
||||||
|
|
||||||
This function concatenates two Null-terminated Unicode strings. The contents
|
This function concatenates two Null-terminated Unicode strings. The contents
|
||||||
|
@ -733,7 +732,7 @@ IsHexDigit (
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convert one Null-terminated Unicode string to a Null-terminated
|
Convert a Null-terminated Unicode string to a Null-terminated
|
||||||
ASCII string and returns the ASCII string.
|
ASCII string and returns the ASCII string.
|
||||||
|
|
||||||
This function converts the content of the Unicode string Source
|
This function converts the content of the Unicode string Source
|
||||||
|
@ -800,9 +799,8 @@ AsciiStrCpy (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copies one Null-terminated ASCII string with a maximum length to another
|
Copies up to a specified length one Null-terminated ASCII string to another
|
||||||
Null-terminated ASCII string with a maximum length and returns the new ASCII
|
Null-terminated ASCII string and returns the new ASCII string.
|
||||||
string.
|
|
||||||
|
|
||||||
This function copies the contents of the ASCII string Source to the ASCII
|
This function copies the contents of the ASCII string Source to the ASCII
|
||||||
string Destination, and returns Destination. At most, Length ASCII characters
|
string Destination, and returns Destination. At most, Length ASCII characters
|
||||||
|
@ -904,8 +902,8 @@ AsciiStrSize (
|
||||||
@param FirstString Pointer to a Null-terminated ASCII string.
|
@param FirstString Pointer to a Null-terminated ASCII string.
|
||||||
@param SecondString Pointer to a Null-terminated ASCII string.
|
@param SecondString Pointer to a Null-terminated ASCII string.
|
||||||
|
|
||||||
@retval 0 FirstString is identical to SecondString.
|
@retval ==0 FirstString is identical to SecondString.
|
||||||
@return others FirstString is not identical to SecondString.
|
@retval !=0 FirstString is not identical to SecondString.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
INTN
|
INTN
|
||||||
|
@ -939,9 +937,9 @@ AsciiStrCmp (
|
||||||
@param FirstString Pointer to a Null-terminated ASCII string.
|
@param FirstString Pointer to a Null-terminated ASCII string.
|
||||||
@param SecondString Pointer to a Null-terminated ASCII string.
|
@param SecondString Pointer to a Null-terminated ASCII string.
|
||||||
|
|
||||||
@retval 0 FirstString is identical to SecondString using case insensitive
|
@retval ==0 FirstString is identical to SecondString using case insensitive
|
||||||
comparisons.
|
comparisons.
|
||||||
@return others FirstString is not identical to SecondString using case
|
@retval !=0 FirstString is not identical to SecondString using case
|
||||||
insensitive comparisons.
|
insensitive comparisons.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -977,8 +975,8 @@ AsciiStriCmp (
|
||||||
@param SecondString Pointer to a Null-terminated ASCII string.
|
@param SecondString Pointer to a Null-terminated ASCII string.
|
||||||
@param Length Maximum number of ASCII characters for compare.
|
@param Length Maximum number of ASCII characters for compare.
|
||||||
|
|
||||||
@retval 0 FirstString is identical to SecondString.
|
@retval ==0 FirstString is identical to SecondString.
|
||||||
@return others FirstString is not identical to SecondString.
|
@retval !=0 FirstString is not identical to SecondString.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
INTN
|
INTN
|
||||||
|
@ -1026,9 +1024,9 @@ AsciiStrCat (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Concatenates one Null-terminated ASCII string with a maximum length to the
|
Concatenates up to a specified length one Null-terminated ASCII string to
|
||||||
end of another Null-terminated ASCII string, and returns the concatenated
|
the end of another Null-terminated ASCII string, and returns the
|
||||||
ASCII string.
|
concatenated ASCII string.
|
||||||
|
|
||||||
This function concatenates two Null-terminated ASCII strings. The contents
|
This function concatenates two Null-terminated ASCII strings. The contents
|
||||||
of Null-terminated ASCII string Source are concatenated to the end of Null-
|
of Null-terminated ASCII string Source are concatenated to the end of Null-
|
||||||
|
@ -1088,7 +1086,8 @@ AsciiStrnCat (
|
||||||
@param SearchString Pointer to a Null-terminated ASCII string to search for.
|
@param SearchString Pointer to a Null-terminated ASCII string to search for.
|
||||||
|
|
||||||
@retval NULL If the SearchString does not appear in String.
|
@retval NULL If the SearchString does not appear in String.
|
||||||
@return others If there is a match.
|
@retval others If there is a match return the first occurrence of SearchingString.
|
||||||
|
If the lenth of SearchString is zero,return String.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
|
@ -1349,7 +1348,7 @@ BcdToDecimal8 (
|
||||||
@param ListHead The head note of a list to initiailize.
|
@param ListHead The head note of a list to initiailize.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&ListHead, &ListHead}
|
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1384,7 +1383,8 @@ InitializeListHead (
|
||||||
|
|
||||||
If ListHead is NULL, then ASSERT().
|
If ListHead is NULL, then ASSERT().
|
||||||
If Entry is NULL, then ASSERT().
|
If Entry is NULL, then ASSERT().
|
||||||
If ListHead was not initialized with InitializeListHead(), then ASSERT().
|
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
|
||||||
|
InitializeListHead(), then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
|
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
|
||||||
of nodes in ListHead, including the ListHead node, is greater than or
|
of nodes in ListHead, including the ListHead node, is greater than or
|
||||||
equal to PcdMaximumLinkedListLength, then ASSERT().
|
equal to PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1413,7 +1413,8 @@ InsertHeadList (
|
||||||
|
|
||||||
If ListHead is NULL, then ASSERT().
|
If ListHead is NULL, then ASSERT().
|
||||||
If Entry is NULL, then ASSERT().
|
If Entry is NULL, then ASSERT().
|
||||||
If ListHead was not initialized with InitializeListHead(), then ASSERT().
|
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
|
||||||
|
InitializeListHead(), then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
|
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
|
||||||
of nodes in ListHead, including the ListHead node, is greater than or
|
of nodes in ListHead, including the ListHead node, is greater than or
|
||||||
equal to PcdMaximumLinkedListLength, then ASSERT().
|
equal to PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1437,11 +1438,12 @@ InsertTailList (
|
||||||
Retrieves the first node of a doubly linked list.
|
Retrieves the first node of a doubly linked list.
|
||||||
|
|
||||||
Returns the first node of a doubly linked list. List must have been
|
Returns the first node of a doubly linked list. List must have been
|
||||||
initialized with InitializeListHead(). If List is empty, then NULL is
|
initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
|
||||||
returned.
|
If List is empty, then List is returned.
|
||||||
|
|
||||||
If List is NULL, then ASSERT().
|
If List is NULL, then ASSERT().
|
||||||
If List was not initialized with InitializeListHead(), then ASSERT().
|
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
|
||||||
|
InitializeListHead(), then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
||||||
in List, including the List node, is greater than or equal to
|
in List, including the List node, is greater than or equal to
|
||||||
PcdMaximumLinkedListLength, then ASSERT().
|
PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1462,13 +1464,14 @@ GetFirstNode (
|
||||||
/**
|
/**
|
||||||
Retrieves the next node of a doubly linked list.
|
Retrieves the next node of a doubly linked list.
|
||||||
|
|
||||||
Returns the node of a doubly linked list that follows Node. List must have
|
Returns the node of a doubly linked list that follows Node.
|
||||||
been initialized with InitializeListHead(). If List is empty, then List is
|
List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
|
||||||
returned.
|
or InitializeListHead(). If List is empty, then List is returned.
|
||||||
|
|
||||||
If List is NULL, then ASSERT().
|
If List is NULL, then ASSERT().
|
||||||
If Node is NULL, then ASSERT().
|
If Node is NULL, then ASSERT().
|
||||||
If List was not initialized with InitializeListHead(), 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
|
If PcdMaximumLinkedListLenth is not zero, and List contains more than
|
||||||
PcdMaximumLinkedListLenth nodes, then ASSERT().
|
PcdMaximumLinkedListLenth nodes, then ASSERT().
|
||||||
If Node is not a node in List, then ASSERT().
|
If Node is not a node in List, then ASSERT().
|
||||||
|
@ -1495,7 +1498,8 @@ GetNextNode (
|
||||||
zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
|
zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
|
||||||
|
|
||||||
If ListHead is NULL, then ASSERT().
|
If ListHead is NULL, then ASSERT().
|
||||||
If ListHead was not initialized with InitializeListHead(), then ASSERT().
|
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
|
||||||
|
InitializeListHead(), then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
||||||
in List, including the List node, is greater than or equal to
|
in List, including the List node, is greater than or equal to
|
||||||
PcdMaximumLinkedListLength, then ASSERT().
|
PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1520,11 +1524,12 @@ IsListEmpty (
|
||||||
|
|
||||||
Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the
|
Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the
|
||||||
nodes in the doubly linked list specified by List. List must have been
|
nodes in the doubly linked list specified by List. List must have been
|
||||||
initialized with InitializeListHead().
|
initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
|
||||||
|
|
||||||
If List is NULL, then ASSERT().
|
If List is NULL, then ASSERT().
|
||||||
If Node is NULL, then ASSERT().
|
If Node is NULL, then ASSERT().
|
||||||
If List was not initialized with InitializeListHead(), then ASSERT().
|
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(),
|
||||||
|
then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
||||||
in List, including the List node, is greater than or equal to
|
in List, including the List node, is greater than or equal to
|
||||||
PcdMaximumLinkedListLength, then ASSERT().
|
PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1550,11 +1555,12 @@ IsNull (
|
||||||
|
|
||||||
Returns TRUE if Node is the last node in the doubly linked list specified by
|
Returns TRUE if Node is the last node in the doubly linked list specified by
|
||||||
List. Otherwise, FALSE is returned. List must have been initialized with
|
List. Otherwise, FALSE is returned. List must have been initialized with
|
||||||
InitializeListHead().
|
INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
|
||||||
|
|
||||||
If List is NULL, then ASSERT().
|
If List is NULL, then ASSERT().
|
||||||
If Node is NULL, then ASSERT().
|
If Node is NULL, then ASSERT().
|
||||||
If List was not initialized with InitializeListHead(), then ASSERT().
|
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
|
||||||
|
InitializeListHead(), then ASSERT().
|
||||||
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
If PcdMaximumLinkedListLenth is not zero, and the number of nodes
|
||||||
in List, including the List node, is greater than or equal to
|
in List, including the List node, is greater than or equal to
|
||||||
PcdMaximumLinkedListLength, then ASSERT().
|
PcdMaximumLinkedListLength, then ASSERT().
|
||||||
|
@ -1583,8 +1589,8 @@ IsNodeAtEnd (
|
||||||
Otherwise, the location of the FirstEntry node is swapped with the location
|
Otherwise, the location of the FirstEntry node is swapped with the location
|
||||||
of the SecondEntry node in a doubly linked list. SecondEntry must be in the
|
of the SecondEntry node in a doubly linked list. SecondEntry must be in the
|
||||||
same double linked list as FirstEntry and that double linked list must have
|
same double linked list as FirstEntry and that double linked list must have
|
||||||
been initialized with InitializeListHead(). SecondEntry is returned after the
|
been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
|
||||||
nodes are swapped.
|
SecondEntry is returned after the nodes are swapped.
|
||||||
|
|
||||||
If FirstEntry is NULL, then ASSERT().
|
If FirstEntry is NULL, then ASSERT().
|
||||||
If SecondEntry is NULL, then ASSERT().
|
If SecondEntry is NULL, then ASSERT().
|
||||||
|
@ -1721,7 +1727,7 @@ ARShiftU64 (
|
||||||
@param Operand The 32-bit operand to rotate left.
|
@param Operand The 32-bit operand to rotate left.
|
||||||
@param Count The number of bits to rotate left.
|
@param Count The number of bits to rotate left.
|
||||||
|
|
||||||
@return Operand <<< Count
|
@return Operand << Count
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
|
@ -1769,7 +1775,7 @@ RRotU32 (
|
||||||
@param Operand The 64-bit operand to rotate left.
|
@param Operand The 64-bit operand to rotate left.
|
||||||
@param Count The number of bits to rotate left.
|
@param Count The number of bits to rotate left.
|
||||||
|
|
||||||
@return Operand <<< Count
|
@return Operand << Count
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
|
@ -1793,7 +1799,7 @@ LRotU64 (
|
||||||
@param Operand The 64-bit operand to rotate right.
|
@param Operand The 64-bit operand to rotate right.
|
||||||
@param Count The number of bits to rotate right.
|
@param Count The number of bits to rotate right.
|
||||||
|
|
||||||
@return Operand >>> Count
|
@return Operand >> Count
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
|
@ -1813,7 +1819,7 @@ RRotU64 (
|
||||||
|
|
||||||
@param Operand The 32-bit operand to evaluate.
|
@param Operand The 32-bit operand to evaluate.
|
||||||
|
|
||||||
@return Position of the lowest bit set in Operand if found.
|
@retval 0-31 The lowest bit set in Operand was found.
|
||||||
@retval -1 Operand is zero.
|
@retval -1 Operand is zero.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -1833,9 +1839,10 @@ LowBitSet32 (
|
||||||
|
|
||||||
@param Operand The 64-bit operand to evaluate.
|
@param Operand The 64-bit operand to evaluate.
|
||||||
|
|
||||||
@return Position of the lowest bit set in Operand if found.
|
@retval 0-63 The lowest bit set in Operand was found.
|
||||||
@retval -1 Operand is zero.
|
@retval -1 Operand is zero.
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
INTN
|
INTN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -1854,7 +1861,7 @@ LowBitSet64 (
|
||||||
|
|
||||||
@param Operand The 32-bit operand to evaluate.
|
@param Operand The 32-bit operand to evaluate.
|
||||||
|
|
||||||
@return Position of the highest bit set in Operand if found.
|
@retval 0-31 Position of the highest bit set in Operand if found.
|
||||||
@retval -1 Operand is zero.
|
@retval -1 Operand is zero.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -1875,7 +1882,7 @@ HighBitSet32 (
|
||||||
|
|
||||||
@param Operand The 64-bit operand to evaluate.
|
@param Operand The 64-bit operand to evaluate.
|
||||||
|
|
||||||
@return Position of the highest bit set in Operand if found.
|
@retval 0-63 Position of the highest bit set in Operand if found.
|
||||||
@retval -1 Operand is zero.
|
@retval -1 Operand is zero.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -1888,7 +1895,7 @@ HighBitSet64 (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the value of the highest bit set in a 32-bit value. Equivalent to
|
Returns the value of the highest bit set in a 32-bit value. Equivalent to
|
||||||
1 << HighBitSet32(x).
|
1 << log2(x).
|
||||||
|
|
||||||
This function computes the value of the highest bit set in the 32-bit value
|
This function computes the value of the highest bit set in the 32-bit value
|
||||||
specified by Operand. If Operand is zero, then zero is returned.
|
specified by Operand. If Operand is zero, then zero is returned.
|
||||||
|
@ -1908,7 +1915,7 @@ GetPowerOfTwo32 (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the value of the highest bit set in a 64-bit value. Equivalent to
|
Returns the value of the highest bit set in a 64-bit value. Equivalent to
|
||||||
1 << HighBitSet64(x).
|
1 << log2(x).
|
||||||
|
|
||||||
This function computes the value of the highest bit set in the 64-bit value
|
This function computes the value of the highest bit set in the 64-bit value
|
||||||
specified by Operand. If Operand is zero, then zero is returned.
|
specified by Operand. If Operand is zero, then zero is returned.
|
||||||
|
@ -1935,7 +1942,7 @@ GetPowerOfTwo64 (
|
||||||
|
|
||||||
@param Value Operand A 16-bit unsigned value.
|
@param Value Operand A 16-bit unsigned value.
|
||||||
|
|
||||||
@return The byte swaped Operand.
|
@return The byte swapped Operand.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
|
@ -1954,7 +1961,7 @@ SwapBytes16 (
|
||||||
|
|
||||||
@param Value Operand A 32-bit unsigned value.
|
@param Value Operand A 32-bit unsigned value.
|
||||||
|
|
||||||
@return The byte swaped Operand.
|
@return The byte swapped Operand.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
|
@ -1973,7 +1980,7 @@ SwapBytes32 (
|
||||||
|
|
||||||
@param Value Operand A 64-bit unsigned value.
|
@param Value Operand A 64-bit unsigned value.
|
||||||
|
|
||||||
@return The byte swaped Operand.
|
@return The byte swapped Operand.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
|
@ -2168,6 +2175,10 @@ DivU64x64Remainder (
|
||||||
NULL, then the 64-bit signed remainder is returned in Remainder. This
|
NULL, then the 64-bit signed remainder is returned in Remainder. This
|
||||||
function returns the 64-bit signed quotient.
|
function returns the 64-bit signed quotient.
|
||||||
|
|
||||||
|
It is the caller¡¯s responsibility to not call this function with a Divisor of 0.
|
||||||
|
If Divisor is 0, then the quotient and remainder should be assumed to be
|
||||||
|
the largest negative integer.
|
||||||
|
|
||||||
If Divisor is 0, then ASSERT().
|
If Divisor is 0, then ASSERT().
|
||||||
|
|
||||||
@param Dividend A 64-bit signed value.
|
@param Dividend A 64-bit signed value.
|
||||||
|
@ -3264,7 +3275,7 @@ InterlockedCompareExchangePointer (
|
||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calculate the sum of all elements in a buffer in unit of UINT8.
|
Returns the sum of all elements in a buffer in unit of UINT8.
|
||||||
During calculation, the carry bits are dropped.
|
During calculation, the carry bits are dropped.
|
||||||
|
|
||||||
This function calculates the sum of all elements in a buffer
|
This function calculates the sum of all elements in a buffer
|
||||||
|
@ -3276,7 +3287,7 @@ InterlockedCompareExchangePointer (
|
||||||
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
@param Buffer Pointer to the buffer to carry out the sum operation.
|
@param Buffer Pointer to the buffer to carry out the sum operation.
|
||||||
@param Length The size, in bytes, of Buffer .
|
@param Length The size, in bytes, of Buffer.
|
||||||
|
|
||||||
@return Sum The sum of Buffer with carry bits dropped during additions.
|
@return Sum The sum of Buffer with carry bits dropped during additions.
|
||||||
|
|
||||||
|
@ -3516,6 +3527,11 @@ MemoryFence (
|
||||||
If JumpBuffer is NULL, then ASSERT().
|
If JumpBuffer is NULL, then ASSERT().
|
||||||
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
|
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
|
||||||
|
|
||||||
|
NOTE: The structure BASE_LIBRARY_JUMP_BUFFER is CPU architecture specific.
|
||||||
|
The same structure must never be used for more than one CPU architecture context.
|
||||||
|
For example, a BASE_LIBRARY_JUMP_BUFFER allocated by an IA-32 module must never be used from an x64 module.
|
||||||
|
SetJump()/LongJump() is not currently supported for the EBC processor type.
|
||||||
|
|
||||||
@param JumpBuffer A pointer to CPU context buffer.
|
@param JumpBuffer A pointer to CPU context buffer.
|
||||||
|
|
||||||
@retval 0 Indicates a return from SetJump().
|
@retval 0 Indicates a return from SetJump().
|
||||||
|
@ -3719,7 +3735,6 @@ CpuDeadLoop (
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
#if defined (MDE_CPU_IPF)
|
#if defined (MDE_CPU_IPF)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3793,6 +3808,8 @@ AsmFci (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the current value of a Processor Identifier Register (CPUID).
|
Reads the current value of a Processor Identifier Register (CPUID).
|
||||||
|
|
||||||
|
Reads and returns the current value of Processor Identifier Register specified by Index.
|
||||||
The Index of largest implemented CPUID (One less than the number of implemented CPUID
|
The Index of largest implemented CPUID (One less than the number of implemented CPUID
|
||||||
registers) is determined by CPUID [3] bits {7:0}.
|
registers) is determined by CPUID [3] bits {7:0}.
|
||||||
No parameter checking is performed on Index. If the Index value is beyond the
|
No parameter checking is performed on Index. If the Index value is beyond the
|
||||||
|
@ -4833,9 +4850,9 @@ AsmReadSp (
|
||||||
and -1 is returned.
|
and -1 is returned.
|
||||||
This function is only available on IPF.
|
This function is only available on IPF.
|
||||||
|
|
||||||
@return 1 The CPU is in virtual mode.
|
@retval 1 The CPU is in virtual mode.
|
||||||
@return 0 The CPU is in physical mode.
|
@retval 0 The CPU is in physical mode.
|
||||||
@return -1 The CPU is in mixed mode.
|
@retval -1 The CPU is in mixed mode.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
INT64
|
INT64
|
||||||
|
@ -4947,6 +4964,7 @@ PalCallStatic (
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
|
#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
|
||||||
///
|
///
|
||||||
/// IA32 and X64 Specific Functions
|
/// IA32 and X64 Specific Functions
|
||||||
|
@ -5302,7 +5320,8 @@ AsmReadMsr32 (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).
|
Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
|
||||||
|
The upper 32-bits of the MSR are set to zero.
|
||||||
|
|
||||||
Writes the 32-bit value specified by Value to the MSR specified by Index. The
|
Writes the 32-bit value specified by Value to the MSR specified by Index. The
|
||||||
upper 32-bits of the MSR write are set to zero. The 32-bit value written to
|
upper 32-bits of the MSR write are set to zero. The 32-bit value written to
|
||||||
|
@ -6478,7 +6497,7 @@ AsmWriteGdtr (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
|
Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
|
||||||
|
|
||||||
Reads and returns the current IDTR descriptor and returns it in Idtr. This
|
Reads and returns the current IDTR descriptor and returns it in Idtr. This
|
||||||
function is only available on IA-32 and X64.
|
function is only available on IA-32 and X64.
|
||||||
|
@ -6496,7 +6515,7 @@ AsmReadIdtr (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
|
Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
|
||||||
|
|
||||||
Writes the current IDTR descriptor and returns it in Idtr. This function is
|
Writes the current IDTR descriptor and returns it in Idtr. This function is
|
||||||
only available on IA-32 and X64.
|
only available on IA-32 and X64.
|
||||||
|
@ -6530,7 +6549,7 @@ AsmReadLdtr (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Writes the current Local Descriptor Table Register (GDTR) selector.
|
Writes the current Local Descriptor Table Register (LDTR) selector.
|
||||||
|
|
||||||
Writes and the current LDTR descriptor specified by Ldtr. This function is
|
Writes and the current LDTR descriptor specified by Ldtr. This function is
|
||||||
only available on IA-32 and X64.
|
only available on IA-32 and X64.
|
||||||
|
@ -7081,7 +7100,7 @@ AsmDisablePaging32 (
|
||||||
If EntryPoint is 0, then ASSERT().
|
If EntryPoint is 0, then ASSERT().
|
||||||
If NewStack is 0, then ASSERT().
|
If NewStack is 0, then ASSERT().
|
||||||
|
|
||||||
@param CodeSelector The 16-bit selector to load in the CS before EntryPoint
|
@param Cs The 16-bit selector to load in the CS before EntryPoint
|
||||||
is called. The descriptor in the GDT that this selector
|
is called. The descriptor in the GDT that this selector
|
||||||
references must be setup for long mode.
|
references must be setup for long mode.
|
||||||
@param EntryPoint The 64-bit virtual address of the function to call with
|
@param EntryPoint The 64-bit virtual address of the function to call with
|
||||||
|
@ -7099,7 +7118,7 @@ AsmDisablePaging32 (
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
AsmEnablePaging64 (
|
AsmEnablePaging64 (
|
||||||
IN UINT16 CodeSelector,
|
IN UINT16 Cs,
|
||||||
IN UINT64 EntryPoint,
|
IN UINT64 EntryPoint,
|
||||||
IN UINT64 Context1, OPTIONAL
|
IN UINT64 Context1, OPTIONAL
|
||||||
IN UINT64 Context2, OPTIONAL
|
IN UINT64 Context2, OPTIONAL
|
||||||
|
@ -7122,7 +7141,7 @@ AsmEnablePaging64 (
|
||||||
If EntryPoint is 0, then ASSERT().
|
If EntryPoint is 0, then ASSERT().
|
||||||
If NewStack is 0, then ASSERT().
|
If NewStack is 0, then ASSERT().
|
||||||
|
|
||||||
@param CodeSelector The 16-bit selector to load in the CS before EntryPoint
|
@param Cs The 16-bit selector to load in the CS before EntryPoint
|
||||||
is called. The descriptor in the GDT that this selector
|
is called. The descriptor in the GDT that this selector
|
||||||
references must be setup for 32-bit protected mode.
|
references must be setup for 32-bit protected mode.
|
||||||
@param EntryPoint The 64-bit virtual address of the function to call with
|
@param EntryPoint The 64-bit virtual address of the function to call with
|
||||||
|
@ -7140,7 +7159,7 @@ AsmEnablePaging64 (
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
AsmDisablePaging64 (
|
AsmDisablePaging64 (
|
||||||
IN UINT16 CodeSelector,
|
IN UINT16 Cs,
|
||||||
IN UINT32 EntryPoint,
|
IN UINT32 EntryPoint,
|
||||||
IN UINT32 Context1, OPTIONAL
|
IN UINT32 Context1, OPTIONAL
|
||||||
IN UINT32 Context2, OPTIONAL
|
IN UINT32 Context2, OPTIONAL
|
||||||
|
@ -7203,11 +7222,47 @@ AsmPrepareThunk16 (
|
||||||
Transfers control to a 16-bit real mode entry point and returns the results.
|
Transfers control to a 16-bit real mode entry point and returns the results.
|
||||||
|
|
||||||
Transfers control to a 16-bit real mode entry point and returns the results.
|
Transfers control to a 16-bit real mode entry point and returns the results.
|
||||||
AsmPrepareThunk16() must be called with ThunkContext before this function is
|
AsmPrepareThunk16() must be called with ThunkContext before this function is used.
|
||||||
used.
|
This function must be called with interrupts disabled.
|
||||||
|
|
||||||
|
The register state from the RealModeState field of ThunkContext is restored just prior
|
||||||
|
to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState,
|
||||||
|
which is used to set the interrupt state when a 16-bit real mode entry point is called.
|
||||||
|
Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState.
|
||||||
|
The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to
|
||||||
|
the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.
|
||||||
|
The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,
|
||||||
|
so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment
|
||||||
|
and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry
|
||||||
|
point must exit with a RETF instruction. The register state is captured into RealModeState immediately
|
||||||
|
after the RETF instruction is executed.
|
||||||
|
|
||||||
|
If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
|
||||||
|
or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure
|
||||||
|
the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode.
|
||||||
|
|
||||||
|
If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
|
||||||
|
then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode.
|
||||||
|
This includes the base vectors, the interrupt masks, and the edge/level trigger mode.
|
||||||
|
|
||||||
|
If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code
|
||||||
|
is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits.
|
||||||
|
|
||||||
|
If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
|
||||||
|
ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to
|
||||||
|
disable the A20 mask.
|
||||||
|
|
||||||
|
If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in
|
||||||
|
ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails,
|
||||||
|
then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
|
||||||
|
|
||||||
|
If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in
|
||||||
|
ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
|
||||||
|
|
||||||
If ThunkContext is NULL, then ASSERT().
|
If ThunkContext is NULL, then ASSERT().
|
||||||
If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
|
If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
|
||||||
|
If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
|
||||||
|
ThunkAttributes, then ASSERT().
|
||||||
|
|
||||||
@param ThunkContext A pointer to the context structure that describes the
|
@param ThunkContext A pointer to the context structure that describes the
|
||||||
16-bit real mode code to call.
|
16-bit real mode code to call.
|
||||||
|
@ -7231,7 +7286,7 @@ AsmThunk16 (
|
||||||
real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
|
real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
|
||||||
once and AsmThunk16() can be called for each 16-bit real mode thunk.
|
once and AsmThunk16() can be called for each 16-bit real mode thunk.
|
||||||
|
|
||||||
If ThunkContext is NULL, then ASSERT().
|
See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions.
|
||||||
|
|
||||||
@param ThunkContext A pointer to the context structure that describes the
|
@param ThunkContext A pointer to the context structure that describes the
|
||||||
16-bit real mode code to call.
|
16-bit real mode code to call.
|
||||||
|
|
Loading…
Reference in New Issue