git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5956
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
Declaration of internal functions in BaseLib.\r
\r
/** @file\r
Declaration of internal functions in BaseLib.\r
\r
- Copyright (c) 2006 - 2007, 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
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
#include <Library/TimerLib.h>\r
#include <Library/PcdLib.h>\r
\r
#include <Library/TimerLib.h>\r
#include <Library/PcdLib.h>\r
\r
-\r
-#define QUIENT_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 / 10)\r
-#define REMINDER_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 % 10)\r
-\r
-#define QUIENT_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 / 16)\r
-#define REMINDER_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 % 16)\r
-\r
-#define QUIENT_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 / 10)\r
-#define REMINDER_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 % 10)\r
-\r
-#define QUIENT_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 / 16)\r
-#define REMINDER_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 % 16)\r
-\r
//\r
// Math functions\r
//\r
//\r
// Math functions\r
//\r
\r
@param Operand A 64-bit unsigned value.\r
\r
\r
@param Operand A 64-bit unsigned value.\r
\r
- @return The byte swaped Operand.\r
+ @return The byte swapped Operand.\r
unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
function returns the 64-bit unsigned quotient.\r
\r
unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
function returns the 64-bit unsigned quotient.\r
\r
- @param Dividend A 64-bit unsigned value.\r
+ @param Dividend A 64-bit unsigned value.\r
@param Divisor A 32-bit unsigned value.\r
\r
@return Dividend / Divisor\r
@param Divisor A 32-bit unsigned value.\r
\r
@return Dividend / Divisor\r
\r
/**\r
Divides a 64-bit signed integer by a 64-bit signed integer and\r
\r
/**\r
Divides a 64-bit signed integer by a 64-bit signed integer and\r
- generates a 64-bit signed result and a optional 64-bit signed remainder.\r
+ generates a 64-bit signed result and an optional 64-bit signed remainder.\r
- This function divides the 64-bit unsigned value Dividend by the 64-bit\r
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
- This function returns the 64-bit unsigned quotient.\r
+ This function divides the 64-bit signed value Dividend by the 64-bit\r
+ signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
+ is not NULL, then the 64-bit signed remainder is returned in Remainder.\r
+ This function returns the 64-bit signed quotient.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
- Worker function that locates the Node in the List\r
+ Worker function that locates the Node in the List.\r
\r
By searching the List, finds the location of the Node in List. At the same time,\r
verifies the validity of this list.\r
\r
By searching the List, finds the location of the Node in List. At the same time,\r
verifies the validity of this list.\r
- Worker function that returns a bit field from Operand\r
+ Worker function that returns a bit field from Operand.\r
\r
Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
\r
\r
Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
\r
Utility functions to generate checksum based on 2's complement\r
algorithm.\r
\r
Utility functions to generate checksum based on 2's complement\r
algorithm.\r
\r
- Copyright (c) 2007, Intel Corporation<BR>\r
+ Copyright (c) 2007 - 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
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
UINT8\r
EFIAPI\r
CalculateSum8 (\r
UINT8\r
EFIAPI\r
CalculateSum8 (\r
- IN CONST UINT8 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT8 *Buffer,\r
+ IN UINTN Length\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
- @return Checksum The 2's complement checksum of Buffer.\r
+ @return Checksum The 2's complement checksum of Buffer.\r
\r
**/\r
UINT8\r
EFIAPI\r
CalculateCheckSum8 (\r
\r
**/\r
UINT8\r
EFIAPI\r
CalculateCheckSum8 (\r
- IN CONST UINT8 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT8 *Buffer,\r
+ IN UINTN Length\r
)\r
{\r
UINT8 CheckSum;\r
)\r
{\r
UINT8 CheckSum;\r
UINT16\r
EFIAPI\r
CalculateSum16 (\r
UINT16\r
EFIAPI\r
CalculateSum16 (\r
- IN CONST UINT16 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT16 *Buffer,\r
+ IN UINTN Length\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
- @return Checksum The 2's complement checksum of Buffer.\r
+ @return Checksum The 2's complement checksum of Buffer.\r
\r
**/\r
UINT16\r
EFIAPI\r
CalculateCheckSum16 (\r
\r
**/\r
UINT16\r
EFIAPI\r
CalculateCheckSum16 (\r
- IN CONST UINT16 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT16 *Buffer,\r
+ IN UINTN Length\r
)\r
{\r
UINT16 CheckSum;\r
)\r
{\r
UINT16 CheckSum;\r
UINT32\r
EFIAPI\r
CalculateSum32 (\r
UINT32\r
EFIAPI\r
CalculateSum32 (\r
- IN CONST UINT32 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT32 *Buffer,\r
+ IN UINTN Length\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
- @return Checksum The 2's complement checksum of Buffer.\r
+ @return Checksum The 2's complement checksum of Buffer.\r
\r
**/\r
UINT32\r
EFIAPI\r
CalculateCheckSum32 (\r
\r
**/\r
UINT32\r
EFIAPI\r
CalculateCheckSum32 (\r
- IN CONST UINT32 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT32 *Buffer,\r
+ IN UINTN Length\r
)\r
{\r
UINT32 CheckSum;\r
)\r
{\r
UINT32 CheckSum;\r
UINT64\r
EFIAPI\r
CalculateSum64 (\r
UINT64\r
EFIAPI\r
CalculateSum64 (\r
- IN CONST UINT64 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT64 *Buffer,\r
+ IN UINTN Length\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
@param Buffer Pointer to the buffer to carry out the checksum operation.\r
@param Length The size, in bytes, of Buffer.\r
\r
- @return Checksum The 2's complement checksum of Buffer.\r
+ @return Checksum The 2's complement checksum of Buffer.\r
\r
**/\r
UINT64\r
EFIAPI\r
CalculateCheckSum64 (\r
\r
**/\r
UINT64\r
EFIAPI\r
CalculateCheckSum64 (\r
- IN CONST UINT64 *Buffer,\r
- IN UINTN Length\r
+ IN CONST UINT64 *Buffer,\r
+ IN UINTN Length\r
)\r
{\r
UINT64 CheckSum;\r
)\r
{\r
UINT64 CheckSum;\r
Worker function that Divides a 64-bit signed integer by a 64-bit signed integer and\r
generates a 64-bit signed result and a optional 64-bit signed remainder.\r
\r
Worker function that Divides a 64-bit signed integer by a 64-bit signed integer and\r
generates a 64-bit signed result and a optional 64-bit signed remainder.\r
\r
- This function divides the 64-bit unsigned value Dividend by the 64-bit\r
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
- This function returns the 64-bit unsigned quotient.\r
+ This function divides the 64-bit signed value Dividend by the 64-bit\r
+ signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
+ is not NULL, then the 64-bit signed remainder is returned in Remainder.\r
+ This function returns the 64-bit signed quotient.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
\r
If List is NULL, then ASSERT().\r
If List->ForwardLink is NULL, then ASSERT().\r
\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
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
@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
@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
Ptr = RemoveEntryList (FirstEntry);\r
\r
//\r
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
// immediately in front of SecondEntry\r
//\r
if (Ptr->BackLink == SecondEntry) {\r
\r
@param Entry A pointer to a node in a linked list\r
\r
\r
@param Entry A pointer to a node in a linked list\r
\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
Leaf math worker functions that require 64-bit arithmetic support from the\r
compiler.\r
\r
Leaf math worker functions that require 64-bit arithmetic support from the\r
compiler.\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
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
\r
/**\r
Divides a 64-bit signed integer by a 64-bit signed integer and\r
\r
/**\r
Divides a 64-bit signed integer by a 64-bit signed integer and\r
- generates a 64-bit signed result and a optional 64-bit signed remainder.\r
+ generates a 64-bit signed result and a optional 64-bit signed remainder.\r
- This function divides the 64-bit unsigned value Dividend by the 64-bit\r
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
- This function returns the 64-bit unsigned quotient.\r
+ This function divides the 64-bit signed value Dividend by the 64-bit\r
+ signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
+ is not NULL, then the 64-bit signed remainder is returned in Remainder.\r
+ This function returns the 64-bit signed quotient.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
\r
@param Dividend A 64-bit signed value.\r
@param Divisor A 64-bit signed value.\r
/** @file\r
Unicode and ASCII string primatives.\r
\r
/** @file\r
Unicode and ASCII string primatives.\r
\r
- Copyright (c) 2006 - 2007, 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
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
\r
#include "BaseLibInternals.h"\r
\r
\r
#include "BaseLibInternals.h"\r
\r
+#define QUOTIENT_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 / 10)\r
+#define REMAINDER_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 % 10)\r
+\r
+#define QUOTIENT_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 / 16)\r
+#define REMAINDER_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 % 16)\r
+\r
+#define QUOTIENT_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 / 10)\r
+#define REMAINDER_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 % 10)\r
+\r
+#define QUOTIENT_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 / 16)\r
+#define REMAINDER_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 % 16)\r
+\r
/**\r
Copies one Null-terminated Unicode string to another Null-terminated Unicode\r
string and returns the new Unicode string.\r
/**\r
Copies one Null-terminated Unicode string to another Null-terminated Unicode\r
string and returns the new Unicode string.\r
@param Destination Pointer to a Null-terminated Unicode string.\r
@param Source Pointer to a Null-terminated Unicode string.\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
@param Source Pointer to a Null-terminated Unicode string.\r
\r
+ @return Destination pointing to the copied string.\r
// Destination cannot be NULL\r
//\r
ASSERT (Destination != NULL);\r
// Destination cannot be NULL\r
//\r
ASSERT (Destination != NULL);\r
- ASSERT (((UINTN) Destination & 0x01) == 0);\r
+ ASSERT (((UINTN) Destination & BIT0) == 0);\r
\r
//\r
// Destination and source cannot overlap\r
\r
//\r
// Destination and source cannot overlap\r
@param Source Pointer to a Null-terminated Unicode string.\r
@param Length Maximum number of Unicode characters to copy.\r
\r
@param Source Pointer to a Null-terminated Unicode string.\r
@param Length Maximum number of Unicode characters to copy.\r
\r
+ @return Destination pointing to the copied string.\r
// Destination cannot be NULL if Length is not zero\r
//\r
ASSERT (Destination != NULL);\r
// Destination cannot be NULL if Length is not zero\r
//\r
ASSERT (Destination != NULL);\r
- ASSERT (((UINTN) Destination & 0x01) == 0);\r
+ ASSERT (((UINTN) Destination & BIT0) == 0);\r
\r
//\r
// Destination and source cannot overlap\r
\r
//\r
// Destination and source cannot overlap\r
- // Q: Does Source have to be NULL-terminated?\r
//\r
ASSERT ((UINTN)(Destination - Source) > StrLen (Source));\r
ASSERT ((UINTN)(Source - Destination) >= Length);\r
//\r
ASSERT ((UINTN)(Destination - Source) > StrLen (Source));\r
ASSERT ((UINTN)(Source - Destination) >= Length);\r
UINTN Length;\r
\r
ASSERT (String != NULL);\r
UINTN Length;\r
\r
ASSERT (String != NULL);\r
- ASSERT (((UINTN) String & 0x01) == 0);\r
+ ASSERT (((UINTN) String & BIT0) == 0);\r
\r
for (Length = 0; *String != L'\0'; String++, Length++) {\r
//\r
\r
for (Length = 0; *String != L'\0'; String++, Length++) {\r
//\r
@param SecondString Pointer to a Null-terminated Unicode string.\r
\r
@retval 0 FirstString is identical to SecondString.\r
@param SecondString Pointer to a Null-terminated Unicode string.\r
\r
@retval 0 FirstString is identical to SecondString.\r
- @return others FirstString is not identical to SecondString.\r
+ @return The first mismatched Unicode character in SecondString subtracted\r
+ from the first mismatched Unicode character in FirstString.\r
@param Length Maximum number of Unicode characters to compare.\r
\r
@retval 0 FirstString is identical to SecondString.\r
@param Length Maximum number of Unicode characters to compare.\r
\r
@retval 0 FirstString is identical to SecondString.\r
- @return others FirstString is not identical to SecondString.\r
+ @return The value returned is the first mismatched Unicode character in SecondString\r
+ subtracted from the first mismatched Unicode character in FirstString.\r
@param Destination Pointer to a Null-terminated Unicode string.\r
@param Source Pointer to a Null-terminated Unicode string.\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
@param Source Pointer to a Null-terminated Unicode string.\r
\r
+ @return Destination pointing to the concatenated Unicode string.\r
@param Length Maximum number of Unicode characters to concatenate from\r
Source.\r
\r
@param Length Maximum number of Unicode characters to concatenate from\r
Source.\r
\r
+ @return Destination pointing to the concatenated Unicode string.\r
or String contains more than PcdMaximumUnicodeStringLength Unicode \r
characters not including the Null-terminator, then ASSERT().\r
\r
or String contains more than PcdMaximumUnicodeStringLength Unicode \r
characters not including the Null-terminator, then ASSERT().\r
\r
- @param String Pointer to a Null-terminated Unicode string.\r
+ @param String Pointer to a Null-terminated Unicode string.\r
@param SearchString Pointer to a Null-terminated Unicode string to search for.\r
\r
@param SearchString Pointer to a Null-terminated Unicode string to search for.\r
\r
- @retval NULL If the SearchString does not appear in String.\r
- @return others If there is a match.\r
+ @retval NULL If the SearchString does not appear in String.\r
+ @return Pointer to the matching sub-string.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a decmial character.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a decmial character.\r
- @retval FALSE Otherwise.\r
+ @retval FALSE If the Char is not a decmial character.\r
it maps to a valid small-case ASCII character.\r
\r
This internal function only deal with Unicode character\r
it maps to a valid small-case ASCII character.\r
\r
This internal function only deal with Unicode character\r
- which maps to a valid small-case ASII character, i.e.\r
+ which maps to a valid small-case ASCII character, i.e.\r
L'a' to L'z'. For other Unicode character, the input character\r
is returned directly.\r
\r
L'a' to L'z'. For other Unicode character, the input character\r
is returned directly.\r
\r
\r
@param Char The character to convert.\r
\r
\r
@param Char The character to convert.\r
\r
- @retval UINTN The numerical value converted.\r
+ @return The numerical value converted.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a hexadecmial character.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a hexadecmial character.\r
- @retval FALSE Otherwise.\r
+ @retval FALSE If the Char is not a hexadecmial character.\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
+ @return The value of type UINTN converted.\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
- ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) &&\r
- (*String - L'0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)\r
+ ASSERT ((Result < QUOTIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
+ ((QUOTIENT_MAX_UINTN_DIVIDED_BY_10 == Result) &&\r
+ (*String - L'0') <= REMAINDER_MAX_UINTN_DIVIDED_BY_10)\r
);\r
\r
Result = Result * 10 + (*String - L'0');\r
);\r
\r
Result = Result * 10 + (*String - L'0');\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
+ @return The value of type UINT64 converted.\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || \r
- ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
- (*String - L'0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)\r
+ ASSERT ((Result < QUOTIENT_MAX_UINT64_DIVIDED_BY_10) || \r
+ ((QUOTIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
+ (*String - L'0') <= REMAINDER_MAX_UINT64_DIVIDED_BY_10)\r
);\r
\r
Result = MultU64x32 (Result, 10) + (*String - L'0');\r
);\r
\r
Result = MultU64x32 (Result, 10) + (*String - L'0');\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
+ @return The value of type UINTN converted.\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
- ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
- (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))\r
+ ASSERT ((Result < QUOTIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
+ ((QUOTIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
+ (InternalHexCharToUintn (*String) <= REMAINDER_MAX_UINTN_DIVIDED_BY_16))\r
);\r
\r
Result = (Result << 4) + InternalHexCharToUintn (*String);\r
);\r
\r
Result = (Result << 4) + InternalHexCharToUintn (*String);\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
+ @return The value of type UINT64 converted.\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16)|| \r
- ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
- (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))\r
+ ASSERT ((Result < QUOTIENT_MAX_UINT64_DIVIDED_BY_16)|| \r
+ ((QUOTIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
+ (InternalHexCharToUintn (*String) <= REMAINDER_MAX_UINT64_DIVIDED_BY_16))\r
);\r
\r
Result = LShiftU64 (Result, 4);\r
);\r
\r
Result = LShiftU64 (Result, 4);\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a decmial character.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a decmial character.\r
- @retval FALSE Otherwise.\r
+ @retval FALSE If the Char is not a decmial character.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a hexadecmial character.\r
@param Char The character to check against.\r
\r
@retval TRUE If the Char is a hexadecmial character.\r
- @retval FALSE Otherwise.\r
+ @retval FALSE If the Char is not a hexadecmial character.\r
@param Source Pointer to a Null-terminated Unicode string.\r
@param Destination Pointer to a Null-terminated ASCII string.\r
\r
@param Source Pointer to a Null-terminated Unicode string.\r
@param Destination Pointer to a Null-terminated ASCII string.\r
\r
+ @return Destination pointing to the converted ASCII string.\r
@param Destination Pointer to a Null-terminated ASCII string.\r
@param Source Pointer to a Null-terminated ASCII string.\r
\r
@param Destination Pointer to a Null-terminated ASCII string.\r
@param Source Pointer to a Null-terminated ASCII string.\r
\r
+ @return Destination pointing to the copied string.\r
@param Source Pointer to a Null-terminated ASCII string.\r
@param Length Maximum number of ASCII characters to copy.\r
\r
@param Source Pointer to a Null-terminated ASCII string.\r
@param Length Maximum number of ASCII characters to copy.\r
\r
+ @return Destination pointing to the copied string.\r
@param SecondString Pointer to a Null-terminated ASCII string.\r
\r
@retval 0 FirstString is identical to SecondString.\r
@param SecondString Pointer to a Null-terminated ASCII string.\r
\r
@retval 0 FirstString is identical to SecondString.\r
- @return others FirstString is not identical to SecondString.\r
+ @return The first mismatched ASCII character in SecondString subtracted\r
+ from the first mismatched ASCII character in FirstString.\r
- Converts a lowercase Ascii character to upper one\r
+ Converts a lowercase Ascii character to upper one.\r
\r
If Chr is lowercase Ascii character, then converts it to upper one.\r
\r
\r
If Chr is lowercase Ascii character, then converts it to upper one.\r
\r
\r
@param Char The character to convert.\r
\r
\r
@param Char The character to convert.\r
\r
- @retval UINTN The numerical value converted.\r
+ @return The numerical value converted.\r
\r
@retval 0 FirstString is identical to SecondString using case insensitive\r
comparisons.\r
\r
@retval 0 FirstString is identical to SecondString using case insensitive\r
comparisons.\r
- @return others FirstString is not identical to SecondString using case\r
- insensitive comparisons.\r
+ @return The first mismatched lower case ASCII character in SecondString subtracted\r
+ from the first mismatched lower case ASCII character in FirstString.\r
@param Length Maximum number of ASCII characters to compare.\r
\r
@retval 0 FirstString is identical to SecondString.\r
@param Length Maximum number of ASCII characters to compare.\r
\r
@retval 0 FirstString is identical to SecondString.\r
- @return others FirstString is not identical to SecondString.\r
+ @return The first mismatched ASCII character in SecondString subtracted from the\r
+ first mismatched ASCII character in FirstString.\r
@param Destination Pointer to a Null-terminated ASCII string.\r
@param Source Pointer to a Null-terminated ASCII string.\r
\r
@param Destination Pointer to a Null-terminated ASCII string.\r
@param Source Pointer to a Null-terminated ASCII string.\r
\r
+ @return Destination pointing to the concatenated ASCII string.\r
@param Length Maximum number of ASCII characters to concatenate from\r
Source.\r
\r
@param Length Maximum number of ASCII characters to concatenate from\r
Source.\r
\r
+ @return Destination pointing to the concatenated ASCII string.\r
@param SearchString Pointer to a Null-terminated ASCII string to search for.\r
\r
@retval NULL If the SearchString does not appear in String.\r
@param SearchString Pointer to a Null-terminated ASCII string to search for.\r
\r
@retval NULL If the SearchString does not appear in String.\r
- @return others If there is a match.\r
+ @return Pointer to the matching sub-string.\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
+ @return The value of type UINTN converted.\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
- ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) && \r
- (*String - '0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)\r
+ ASSERT ((Result < QUOTIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
+ ((QUOTIENT_MAX_UINTN_DIVIDED_BY_10 == Result) && \r
+ (*String - '0') <= REMAINDER_MAX_UINTN_DIVIDED_BY_10)\r
);\r
\r
Result = Result * 10 + (*String - '0');\r
);\r
\r
Result = Result * 10 + (*String - '0');\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
+ @return The value of type UINT64 converted.\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || \r
- ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
- (*String - '0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)\r
+ ASSERT ((Result < QUOTIENT_MAX_UINT64_DIVIDED_BY_10) || \r
+ ((QUOTIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
+ (*String - '0') <= REMAINDER_MAX_UINT64_DIVIDED_BY_10)\r
);\r
\r
Result = MultU64x32 (Result, 10) + (*String - '0');\r
);\r
\r
Result = MultU64x32 (Result, 10) + (*String - '0');\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
+ @return The value of type UINTN converted.\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
- ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
- (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))\r
+ ASSERT ((Result < QUOTIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
+ ((QUOTIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
+ (InternalAsciiHexCharToUintn (*String) <= REMAINDER_MAX_UINTN_DIVIDED_BY_16))\r
);\r
\r
Result = (Result << 4) + InternalAsciiHexCharToUintn (*String);\r
);\r
\r
Result = (Result << 4) + InternalAsciiHexCharToUintn (*String);\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
+ @return The value of type UINT64 converted.\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
// If the Hex Number represented by String overflows according \r
// to the range defined by UINTN, then ASSERT().\r
//\r
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16) ||\r
- ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
- (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))\r
+ ASSERT ((Result < QUOTIENT_MAX_UINT64_DIVIDED_BY_16) ||\r
+ ((QUOTIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
+ (InternalAsciiHexCharToUintn (*String) <= REMAINDER_MAX_UINT64_DIVIDED_BY_16))\r
);\r
\r
Result = LShiftU64 (Result, 4);\r
);\r
\r
Result = LShiftU64 (Result, 4);\r
@param Source Pointer to a Null-terminated ASCII string.\r
@param Destination Pointer to a Null-terminated Unicode string.\r
\r
@param Source Pointer to a Null-terminated ASCII string.\r
@param Destination Pointer to a Null-terminated Unicode string.\r
\r
+ @return Destination pointing to the converted Unicode string.\r
\r
@param Value The 8-bit value to convert to BCD. Range 0..99.\r
\r
\r
@param Value The 8-bit value to convert to BCD. Range 0..99.\r
\r
- @return The BCD value\r
+ @return The BCD value converted.\r
\r
@param Value The 8-bit BCD value to convert to an 8-bit value.\r
\r
\r
@param Value The 8-bit BCD value to convert to an 8-bit value.\r
\r
- @return The 8-bit value is returned.\r
+ @return The 8-bit decimal value converted.\r
\r
@param Nibble The nibble which is in the low 4 bits of the input byte.\r
\r
\r
@param Nibble The nibble which is in the low 4 bits of the input byte.\r
\r
- @retval CHAR16 The Unicode hexadecimal character.\r
+ @return The Unicode hexadecimal character.\r
the input buffer for a 64-bits unsigned integrer 0x12345678abcdef1234 will be converted to\r
a Unicode string equal to L"12345678abcdef1234".\r
\r
the input buffer for a 64-bits unsigned integrer 0x12345678abcdef1234 will be converted to\r
a Unicode string equal to L"12345678abcdef1234".\r
\r
- @param String On input, String is pointed to the buffer allocated for the convertion.\r
- @param StringLen The Length of String buffer to hold the output String. The length must include the tailing '\0' character.\r
- The StringLen required to convert a N bytes Buffer will be a least equal to or greater \r
- than 2*N + 1.\r
- @param Buffer The pointer to a input buffer.\r
- @param BufferSizeInBytes Lenth in bytes of the input buffer.\r
+ @param String Pointer to the buffer allocated for the convertion.\r
+ @param StringLen On input: Pointer to length in bytes of buffer to hold the Unicode string.\r
+ On output:If return EFI_SUCCESS, pointer to length of Unicode string converted.\r
+ If return EFI_BUFFER_TOO_SMALL, pointer to length of string buffer desired.\r
+ @param Buffer The pointer to a input buffer.\r
+ @param BufferSizeInBytes Lenth in bytes of the input buffer.\r
-\r
- @retval EFI_SUCCESS The convertion is successfull. All bytes in Buffer has been convert to the corresponding\r
- Unicode character and placed into the right place in String.\r
- @retval EFI_BUFFER_TOO_SMALL StringSizeInBytes is smaller than 2 * N + 1the number of bytes required to\r
- complete the convertion. \r
+ @retval EFI_SUCCESS The convertion is successfull. All bytes in Buffer has been convert to the corresponding\r
+ Unicode character and placed into the right place in String.\r
+ @retval EFI_BUFFER_TOO_SMALL StringSizeInBytes is smaller than 2 * N + 1the number of bytes required to\r
+ complete the convertion. \r
**/\r
RETURN_STATUS\r
EFIAPI\r
**/\r
RETURN_STATUS\r
EFIAPI\r
Unicode character is converted to a byte. For example, Unicode character\r
L'A' will be converted to 0x0A. \r
\r
Unicode character is converted to a byte. For example, Unicode character\r
L'A' will be converted to 0x0A. \r
\r
- If Digit is NULL, then ASSERT.\r
+ If Digit is NULL, then ASSERT().\r
\r
@param Digit The output hexadecimal digit.\r
\r
@param Digit The output hexadecimal digit.\r
@param Char The input Unicode character.\r
\r
@retval TRUE Char is in the range of Hexadecimal number. Digit is updated\r
@param Char The input Unicode character.\r
\r
@retval TRUE Char is in the range of Hexadecimal number. Digit is updated\r
/** @file\r
Switch Stack functions.\r
\r
/** @file\r
Switch Stack functions.\r
\r
- Copyright (c) 2006 - 2007, 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
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
function.\r
@param NewStack A pointer to the new stack to use for the EntryPoint\r
function.\r
function.\r
@param NewStack A pointer to the new stack to use for the EntryPoint\r
function.\r
- @param ... Extended parameters.\r