]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
Remove NibbleToHexChar() function from BaseLib
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index 8f490e6d86a78ca30fa1037bc96e612f1c427bfa..cf4e1896087c111645a6acb14c545495dc56b3ec 100644 (file)
@@ -148,7 +148,7 @@ typedef struct {
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
-  @return Destiantion\r
+  @return Destination.\r
 \r
 **/\r
 CHAR16 *\r
@@ -184,7 +184,7 @@ StrCpy (
   @param  Source      Pointer to a Null-terminated Unicode string.\r
   @param  Length      Maximum number of Unicode characters to copy.\r
 \r
-  @return Destination\r
+  @return Destination.\r
 \r
 **/\r
 CHAR16 *\r
@@ -349,7 +349,7 @@ StrnCmp (
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
-  @return Destination\r
+  @return Destination.\r
 \r
 **/\r
 CHAR16 *\r
@@ -394,7 +394,7 @@ StrCat (
   @param  Length      Maximum number of Unicode characters to concatenate from\r
                       Source.\r
 \r
-  @return Destination\r
+  @return Destination.\r
 \r
 **/\r
 CHAR16 *\r
@@ -406,7 +406,7 @@ StrnCat (
   );\r
 \r
 /**\r
-  Returns the first occurance of a Null-terminated Unicode sub-string\r
+  Returns the first occurrence of a Null-terminated Unicode sub-string\r
   in a Null-terminated Unicode string.\r
 \r
   This function scans the contents of the Null-terminated Unicode string\r
@@ -602,135 +602,6 @@ StrHexToUint64 (
   IN      CONST CHAR16             *String\r
   );\r
 \r
-/**\r
-  Convert a nibble in the low 4 bits of a byte to a Unicode hexadecimal character.\r
-\r
-  This function converts a nibble in the low 4 bits of a byte to a Unicode hexadecimal \r
-  character  For example, the nibble  0x01 and 0x0A will converted to L'1' and L'A' \r
-  respectively.\r
-\r
-  The upper nibble in the input byte will be masked off.\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
-  \r
-**/\r
-CHAR16\r
-EFIAPI\r
-NibbleToHexChar (\r
-  IN UINT8      Nibble\r
-  );\r
-\r
-/** \r
-  Convert binary buffer to a Unicode String in a specified sequence. \r
-\r
-  This function converts bytes in the memory block pointed by Buffer to a Unicode String Str. \r
-  Each byte will be represented by two Unicode characters. For example, byte 0xA1 will \r
-  be converted into two Unicode character L'A' and L'1'. In the output String, the Unicode Character \r
-  for the Most Significant Nibble will be put before the Unicode Character for the Least Significant\r
-  Nibble. The output string for the buffer containing a single byte 0xA1 will be L"A1". \r
-  For a buffer with multiple bytes, the Unicode character produced by the first byte will be put into the \r
-  the last character in the output string. The one next to first byte will be put into the\r
-  character before the last character. This rules applies to the rest of the bytes. The Unicode\r
-  character by the last byte will be put into the first character in the output string. For example,\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
-  \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
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-BufToHexString (\r
-  IN OUT       CHAR16               *String,\r
-  IN OUT       UINTN                *StringLen,\r
-  IN     CONST UINT8                *Buffer,\r
-  IN           UINTN                BufferSizeInBytes\r
-  );\r
-\r
-\r
-/**\r
-  Convert a Unicode string consisting of hexadecimal characters to a output byte buffer.\r
-\r
-  This function converts a Unicode string consisting of characters in the range of Hexadecimal\r
-  character (L'0' to L'9', L'A' to L'F' and L'a' to L'f') to a output byte buffer. The function will stop\r
-  at the first non-hexadecimal character or the NULL character. The convertion process can be\r
-  simply viewed as the reverse operations defined by BufToHexString. Two Unicode characters will be \r
-  converted into one byte. The first Unicode character represents the Most Significant Nibble and the\r
-  second Unicode character represents the Least Significant Nibble in the output byte. \r
-  The first pair of Unicode characters represents the last byte in the output buffer. The second pair of Unicode \r
-  characters represent the  the byte preceding the last byte. This rule applies to the rest pairs of bytes. \r
-  The last pair represent the first byte in the output buffer. \r
-\r
-  For example, a Unciode String L"12345678" will be converted into a buffer wil the following bytes \r
-  (first byte is the byte in the lowest memory address): "0x78, 0x56, 0x34, 0x12".\r
-\r
-  If String has N valid hexadecimal characters for conversion,  the caller must make sure Buffer is at least \r
-  N/2 (if N is even) or (N+1)/2 (if N if odd) bytes. \r
-\r
-  @param Buffer                      The output buffer allocated by the caller.\r
-  @param BufferSizeInBytes           On input, the size in bytes of Buffer. On output, it is updated to \r
-                                     contain the size of the Buffer which is actually used for the converstion.\r
-                                     For Unicode string with 2*N hexadecimal characters (not including the \r
-                                     tailing NULL character), N bytes of Buffer will be used for the output.\r
-  @param String                      The input hexadecimal string.\r
-  @param ConvertedStrLen             The number of hexadecimal characters used to produce content in output\r
-                                     buffer Buffer.\r
-\r
-  @retval  RETURN_BUFFER_TOO_SMALL   The input BufferSizeInBytes is too small to hold the output. BufferSizeInBytes\r
-                                     will be updated to the size required for the converstion.\r
-  @retval  RETURN_SUCCESS            The convertion is successful or the first Unicode character from String\r
-                                     is hexadecimal. If ConvertedStrLen is not NULL, it is updated\r
-                                     to the number of hexadecimal character used for the converstion.\r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-HexStringToBuf (\r
-  OUT          UINT8                    *Buffer,   \r
-  IN OUT       UINTN                    *BufferSizeInBytes,\r
-  IN     CONST CHAR16                   *String,\r
-  OUT          UINTN                    *ConvertedStrLen  OPTIONAL\r
-  );\r
-\r
-\r
-/**\r
-  Test if  a Unicode character is a hexadecimal digit. If true, the input\r
-  Unicode character is converted to a byte. \r
-\r
-  This function tests if a Unicode character is a hexadecimal digit. If true, the input\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
-\r
-  @param  Digit       The output hexadecimal digit.\r
-\r
-  @param  Char        The input Unicode character.\r
-\r
-  @retval TRUE        Char is in the range of Hexadecimal number. Digit is updated\r
-                      to the byte value of the number.\r
-  @retval FALSE       Char is not in the range of Hexadecimal number. Digit is keep\r
-                      intact.\r
-  \r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsHexDigit (\r
-  OUT UINT8      *Digit,\r
-  IN  CHAR16      Char\r
-  );\r
-\r
 /**\r
   Convert a Null-terminated Unicode string to a Null-terminated\r
   ASCII string and returns the ASCII string.\r
@@ -758,7 +629,7 @@ IsHexDigit (
   @param  Source        Pointer to a Null-terminated Unicode string.\r
   @param  Destination   Pointer to a Null-terminated ASCII string.\r
 \r
-  @return Destination\r
+  @return Destination.\r
 \r
 **/\r
 CHAR8 *\r
@@ -1067,7 +938,7 @@ AsciiStrnCat (
 \r
 \r
 /**\r
-  Returns the first occurance of a Null-terminated ASCII sub-string\r
+  Returns the first occurrence of a Null-terminated ASCII sub-string\r
   in a Null-terminated ASCII string.\r
 \r
   This function scans the contents of the ASCII string specified by String\r
@@ -1087,7 +958,7 @@ AsciiStrnCat (
 \r
   @retval NULL            If the SearchString does not appear in String.\r
   @retval others          If there is a match return the first occurrence of SearchingString.\r
-                          If the lenth of SearchString is zero,return String.\r
+                          If the length of SearchString is zero,return String.\r
 \r
 **/\r
 CHAR8 *\r
@@ -1278,7 +1149,7 @@ AsciiStrHexToUint64 (
   @param  Source        Pointer to a Null-terminated ASCII string.\r
   @param  Destination   Pointer to a Null-terminated Unicode string.\r
 \r
-  @return Destination\r
+  @return Destination.\r
 \r
 **/\r
 CHAR16 *\r
@@ -1299,7 +1170,7 @@ AsciiStrToUnicodeStr (
 \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.\r
 \r
 **/\r
 UINT8\r
@@ -1603,7 +1474,7 @@ IsNodeAtEnd (
   @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\r
+  @return SecondEntry.\r
 \r
 **/\r
 LIST_ENTRY *\r
@@ -1630,9 +1501,9 @@ SwapListEntries (
   linked list containing Entry, including the Entry node, is greater than\r
   or equal to PcdMaximumLinkedListLength, then ASSERT().\r
 \r
-  @param  Entry A pointer to a node in a linked list\r
+  @param  Entry A pointer to a node in a linked list.\r
 \r
-  @return Entry\r
+  @return Entry.\r
 \r
 **/\r
 LIST_ENTRY *\r
@@ -1657,7 +1528,7 @@ RemoveEntryList (
   @param  Operand The 64-bit operand to shift left.\r
   @param  Count   The number of bits to shift left.\r
 \r
-  @return Operand << Count\r
+  @return Operand << Count.\r
 \r
 **/\r
 UINT64\r
@@ -1819,7 +1690,7 @@ RRotU64 (
 \r
   @param  Operand The 32-bit operand to evaluate.\r
 \r
-  @retval 0-31  The lowest bit set in Operand was found.\r
+  @retval 0..31  The lowest bit set in Operand was found.\r
   @retval -1    Operand is zero.\r
 \r
 **/\r
@@ -1839,7 +1710,7 @@ LowBitSet32 (
 \r
   @param  Operand The 64-bit operand to evaluate.\r
 \r
-  @retval 0-63  The lowest bit set in Operand was found.\r
+  @retval 0..63  The lowest bit set in Operand was found.\r
   @retval -1    Operand is zero.\r
 \r
 \r
@@ -1861,7 +1732,7 @@ LowBitSet64 (
 \r
   @param  Operand The 32-bit operand to evaluate.\r
 \r
-  @retval 0-31  Position of the highest bit set in Operand if found.\r
+  @retval 0..31  Position of the highest bit set in Operand if found.\r
   @retval -1    Operand is zero.\r
 \r
 **/\r
@@ -1882,7 +1753,7 @@ HighBitSet32 (
 \r
   @param  Operand The 64-bit operand to evaluate.\r
 \r
-  @retval 0-63   Position of the highest bit set in Operand if found.\r
+  @retval 0..63   Position of the highest bit set in Operand if found.\r
   @retval -1     Operand is zero.\r
 \r
 **/\r
@@ -1998,8 +1869,6 @@ SwapBytes64 (
   unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
   bit unsigned result is returned.\r
 \r
-  If the result overflows, then ASSERT().\r
-\r
   @param  Multiplicand  A 64-bit unsigned value.\r
   @param  Multiplier    A 32-bit unsigned value.\r
 \r
@@ -2046,8 +1915,6 @@ MultU64x64 (
   signed value Multiplier and generates a 64-bit signed result. This 64-bit\r
   signed result is returned.\r
 \r
-  If the result overflows, then ASSERT().\r
-\r
   @param  Multiplicand  A 64-bit signed value.\r
   @param  Multiplier    A 64-bit signed value.\r
 \r
@@ -2175,7 +2042,7 @@ DivU64x64Remainder (
   NULL, then the 64-bit signed remainder is returned in Remainder. This\r
   function returns the 64-bit signed quotient.\r
 \r
-  It is the caller¡¯s responsibility to not call this function with a Divisor of 0.\r
+  It is the caller's responsibility to not call this function with a Divisor of 0.\r
   If Divisor is 0, then the quotient and remainder should be assumed to be \r
   the largest negative integer.\r
 \r
@@ -3089,7 +2956,7 @@ InitializeSpinLock (
 \r
   @param  SpinLock  A pointer to the spin lock to place in the acquired state.\r
 \r
-  @return SpinLock accquired lock.\r
+  @return SpinLock acquired lock.\r
 \r
 **/\r
 SPIN_LOCK *\r
@@ -3295,8 +3162,8 @@ InterlockedCompareExchangePointer (
 UINT8\r
 EFIAPI\r
 CalculateSum8 (\r
-  IN      CONST UINT8                 *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3315,14 +3182,14 @@ CalculateSum8 (
   @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
-  IN      CONST UINT8                 *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3348,8 +3215,8 @@ CalculateCheckSum8 (
 UINT16\r
 EFIAPI\r
 CalculateSum16 (\r
-  IN      CONST UINT16                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3370,14 +3237,14 @@ CalculateSum16 (
   @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
-  IN      CONST UINT16                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3403,8 +3270,8 @@ CalculateCheckSum16 (
 UINT32\r
 EFIAPI\r
 CalculateSum32 (\r
-  IN      CONST UINT32                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3425,14 +3292,14 @@ CalculateSum32 (
   @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
-  IN      CONST UINT32                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3458,8 +3325,8 @@ CalculateCheckSum32 (
 UINT64\r
 EFIAPI\r
 CalculateSum64 (\r
-  IN      CONST UINT64                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3480,14 +3347,14 @@ CalculateSum64 (
   @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
-  IN      CONST UINT64                *Buffer,\r
-  IN      UINTN                                      Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   );\r
 \r
 \r
@@ -3691,7 +3558,10 @@ CpuPause (
                       function.\r
   @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
                       function.\r
-  @param  ...         Extended parameters.\r
+  @param  ...         This variable argument list is ignored for IA32, x64, and EBC.  \r
+                      For IPF, this variable argument list is expected to contain \r
+                      a single parameter of type VOID * that specifies the new backing \r
+                      store pointer.\r
 \r
 \r
 **/\r
@@ -3776,7 +3646,7 @@ IpfFlushCacheRange (
   The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).\r
   An implementation may flush a larger region.  This function is only available on IPF.\r
 \r
-  @param Address       The Address of cache line to be flushed.\r
+  @param Address    The Address of cache line to be flushed.\r
 \r
   @return The address of FC instruction executed.\r
 \r
@@ -3794,7 +3664,7 @@ AsmFc (
   The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).\r
   An implementation may flush a larger region.  This function is only available on IPF.\r
 \r
-  @param Address       The Address of cache line to be flushed.\r
+  @param Address    The Address of cache line to be flushed.\r
 \r
   @return The address of FC.I instruction executed.\r
 \r
@@ -3817,7 +3687,7 @@ AsmFci (
   must either guarantee that Index is valid, or the caller must set up fault handlers to\r
   catch the faults.  This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Processor Identifier Register index to read.\r
+  @param Index    The 8-bit Processor Identifier Register index to read.\r
 \r
   @return The current value of Processor Identifier Register specified by Index.\r
 \r
@@ -3851,7 +3721,7 @@ AsmReadPsr (
   The caller must either guarantee that Value is valid, or the caller must set up\r
   fault handlers to catch the faults. This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to PSR.\r
+  @param Value    The 64-bit value to write to PSR.\r
 \r
   @return The 64-bit value written to the PSR.\r
 \r
@@ -3979,7 +3849,7 @@ AsmReadKr7 (
   Write the current value of 64-bit Kernel Register #0 (KR0).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR0.\r
+  @param  Value   The 64-bit value to write to KR0.\r
 \r
   @return The 64-bit value written to the KR0.\r
 \r
@@ -3995,7 +3865,7 @@ AsmWriteKr0 (
   Write the current value of 64-bit Kernel Register #1 (KR1).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR1.\r
+  @param  Value   The 64-bit value to write to KR1.\r
 \r
   @return The 64-bit value written to the KR1.\r
 \r
@@ -4011,7 +3881,7 @@ AsmWriteKr1 (
   Write the current value of 64-bit Kernel Register #2 (KR2).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR2.\r
+  @param  Value   The 64-bit value to write to KR2.\r
 \r
   @return The 64-bit value written to the KR2.\r
 \r
@@ -4027,7 +3897,7 @@ AsmWriteKr2 (
   Write the current value of 64-bit Kernel Register #3 (KR3).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR3.\r
+  @param  Value   The 64-bit value to write to KR3.\r
 \r
   @return The 64-bit value written to the KR3.\r
 \r
@@ -4043,7 +3913,7 @@ AsmWriteKr3 (
   Write the current value of 64-bit Kernel Register #4 (KR4).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR4.\r
+  @param  Value   The 64-bit value to write to KR4.\r
 \r
   @return The 64-bit value written to the KR4.\r
 \r
@@ -4059,7 +3929,7 @@ AsmWriteKr4 (
   Write the current value of 64-bit Kernel Register #5 (KR5).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR5.\r
+  @param  Value   The 64-bit value to write to KR5.\r
 \r
   @return The 64-bit value written to the KR5.\r
 \r
@@ -4075,7 +3945,7 @@ AsmWriteKr5 (
   Write the current value of 64-bit Kernel Register #6 (KR6).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR6.\r
+  @param  Value   The 64-bit value to write to KR6.\r
 \r
   @return The 64-bit value written to the KR6.\r
 \r
@@ -4091,7 +3961,7 @@ AsmWriteKr6 (
   Write the current value of 64-bit Kernel Register #7 (KR7).\r
   This function is only available on IPF.\r
 \r
-  @param  Value        The 64-bit value to write to KR7.\r
+  @param  Value   The 64-bit value to write to KR7.\r
 \r
   @return The 64-bit value written to the KR7.\r
 \r
@@ -4148,7 +4018,7 @@ AsmReadItm (
   Writes the current value of 64-bit Interval Timer Counter Register (ITC).\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to ITC.\r
+  @param Value    The 64-bit value to write to ITC.\r
 \r
   @return The 64-bit value written to the ITC.\r
 \r
@@ -4164,7 +4034,7 @@ AsmWriteItc (
   Writes the current value of 64-bit Interval Timer Match Register (ITM).\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to ITM.\r
+  @param Value    The 64-bit value to write to ITM.\r
 \r
   @return The 64-bit value written to the ITM.\r
 \r
@@ -4184,7 +4054,7 @@ AsmWriteItm (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to ITV.\r
+  @param Value    The 64-bit value to write to ITV.\r
 \r
   @return The 64-bit value written to the ITV.\r
 \r
@@ -4245,7 +4115,7 @@ AsmReadPta (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to DCR.\r
+  @param Value    The 64-bit value to write to DCR.\r
 \r
   @return The 64-bit value written to the DCR.\r
 \r
@@ -4263,7 +4133,7 @@ AsmWriteDcr (
   the low 15 bits of Value is ignored when written.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to IVA.\r
+  @param Value    The 64-bit value to write to IVA.\r
 \r
   @return The 64-bit value written to the IVA.\r
 \r
@@ -4283,7 +4153,7 @@ AsmWriteIva (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to PTA.\r
+  @param Value    The 64-bit value to write to PTA.\r
 \r
   @return The 64-bit value written to the PTA.\r
 **/\r
@@ -4456,7 +4326,7 @@ AsmReadLrr1 (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to LID.\r
+  @param Value    The 64-bit value to write to LID.\r
 \r
   @return The 64-bit value written to the LID.\r
 \r
@@ -4476,7 +4346,7 @@ AsmWriteLid (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to TPR.\r
+  @param Value    The 64-bit value to write to TPR.\r
 \r
   @return The 64-bit value written to the TPR.\r
 \r
@@ -4508,7 +4378,7 @@ AsmWriteEoi (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to PMV.\r
+  @param Value    The 64-bit value to write to PMV.\r
 \r
   @return The 64-bit value written to the PMV.\r
 \r
@@ -4528,7 +4398,7 @@ AsmWritePmv (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to CMCV.\r
+  @param Value    The 64-bit value to write to CMCV.\r
 \r
   @return The 64-bit value written to the CMCV.\r
 \r
@@ -4548,7 +4418,7 @@ AsmWriteCmcv (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to LRR0.\r
+  @param Value    The 64-bit value to write to LRR0.\r
 \r
   @return The 64-bit value written to the LRR0.\r
 \r
@@ -4568,7 +4438,7 @@ AsmWriteLrr0 (
   set up fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Value         The 64-bit value to write to LRR1.\r
+  @param Value    The 64-bit value to write to LRR1.\r
 \r
   @return The 64-bit value written to the LRR1.\r
 \r
@@ -4593,7 +4463,7 @@ AsmWriteLrr1 (
   set up fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Instruction Breakpoint Register index to read.\r
+  @param Index    The 8-bit Instruction Breakpoint Register index to read.\r
 \r
   @return The current value of Instruction Breakpoint Register specified by Index.\r
 \r
@@ -4618,7 +4488,7 @@ AsmReadIbr (
   fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Data Breakpoint Register index to read.\r
+  @param Index    The 8-bit Data Breakpoint Register index to read.\r
 \r
   @return The current value of Data Breakpoint Register specified by Index.\r
 \r
@@ -4643,7 +4513,7 @@ AsmReadDbr (
   zero value will be returned.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Performance Monitor Configuration Register index to read.\r
+  @param Index    The 8-bit Performance Monitor Configuration Register index to read.\r
 \r
   @return The current value of Performance Monitor Configuration Register\r
   specified by Index.\r
@@ -4669,7 +4539,7 @@ AsmReadPmc (
   zero value will be returned.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Performance Monitor Data Register index to read.\r
+  @param Index    The 8-bit Performance Monitor Data Register index to read.\r
 \r
   @return The current value of Performance Monitor Data Register specified by Index.\r
 \r
@@ -4695,8 +4565,8 @@ AsmReadPmd (
   set up fault handlers to catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Instruction Breakpoint Register index to write.\r
-  @param Value         The 64-bit value to write to IBR.\r
+  @param Index    The 8-bit Instruction Breakpoint Register index to write.\r
+  @param Value    The 64-bit value to write to IBR.\r
 \r
   @return The 64-bit value written to the IBR.\r
 \r
@@ -4723,8 +4593,8 @@ AsmWriteIbr (
   catch the faults.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Data Breakpoint Register index to write.\r
-  @param Value         The 64-bit value to write to DBR.\r
+  @param Index    The 8-bit Data Breakpoint Register index to write.\r
+  @param Value    The 64-bit value to write to DBR.\r
 \r
   @return The 64-bit value written to the DBR.\r
 \r
@@ -4750,8 +4620,8 @@ AsmWriteDbr (
   beyond the implemented PMC register range, the write is ignored.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Performance Monitor Configuration Register index to write.\r
-  @param Value         The 64-bit value to write to PMC.\r
+  @param Index    The 8-bit Performance Monitor Configuration Register index to write.\r
+  @param Value    The 64-bit value to write to PMC.\r
 \r
   @return The 64-bit value written to the PMC.\r
 \r
@@ -4777,8 +4647,8 @@ AsmWritePmc (
   Index value is beyond the implemented PMD register range, the write is ignored.\r
   This function is only available on IPF.\r
 \r
-  @param Index         The 8-bit Performance Monitor Data Register index to write.\r
-  @param Value         The 64-bit value to write to PMD.\r
+  @param Index    The 8-bit Performance Monitor Data Register index to write.\r
+  @param Value    The 64-bit value to write to PMD.\r
 \r
   @return The 64-bit value written to the PMD.\r
 \r
@@ -4842,6 +4712,105 @@ AsmReadSp (
   );\r
 \r
 \r
+///\r
+/// Valid Index value for AsmReadControlRegister()\r
+///\r
+#define IPF_CONTROL_REGISTER_DCR   0\r
+#define IPF_CONTROL_REGISTER_ITM   1\r
+#define IPF_CONTROL_REGISTER_IVA   2\r
+#define IPF_CONTROL_REGISTER_PTA   8\r
+#define IPF_CONTROL_REGISTER_IPSR  16\r
+#define IPF_CONTROL_REGISTER_ISR   17\r
+#define IPF_CONTROL_REGISTER_IIP   19\r
+#define IPF_CONTROL_REGISTER_IFA   20\r
+#define IPF_CONTROL_REGISTER_ITIR  21\r
+#define IPF_CONTROL_REGISTER_IIPA  22\r
+#define IPF_CONTROL_REGISTER_IFS   23\r
+#define IPF_CONTROL_REGISTER_IIM   24\r
+#define IPF_CONTROL_REGISTER_IHA   25\r
+#define IPF_CONTROL_REGISTER_LID   64\r
+#define IPF_CONTROL_REGISTER_IVR   65\r
+#define IPF_CONTROL_REGISTER_TPR   66\r
+#define IPF_CONTROL_REGISTER_EOI   67\r
+#define IPF_CONTROL_REGISTER_IRR0  68\r
+#define IPF_CONTROL_REGISTER_IRR1  69\r
+#define IPF_CONTROL_REGISTER_IRR2  70\r
+#define IPF_CONTROL_REGISTER_IRR3  71\r
+#define IPF_CONTROL_REGISTER_ITV   72\r
+#define IPF_CONTROL_REGISTER_PMV   73\r
+#define IPF_CONTROL_REGISTER_CMCV  74\r
+#define IPF_CONTROL_REGISTER_LRR0  80\r
+#define IPF_CONTROL_REGISTER_LRR1  81\r
+\r
+/**\r
+  Reads a 64-bit control register.\r
+\r
+  Reads and returns the control register specified by Index. The valid Index valued are defined\r
+  above in "Related Definitions".\r
+  If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned.  This function is only available on IPF.\r
+\r
+  @param  Index                     The index of the control register to read.\r
+\r
+  @return The control register specified by Index.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadControlRegister (\r
+  IN UINT64  Index\r
+  );\r
+\r
+\r
+///\r
+/// Valid Index value for AsmReadApplicationRegister()\r
+///\r
+#define IPF_APPLICATION_REGISTER_K0        0\r
+#define IPF_APPLICATION_REGISTER_K1        1\r
+#define IPF_APPLICATION_REGISTER_K2        2\r
+#define IPF_APPLICATION_REGISTER_K3        3\r
+#define IPF_APPLICATION_REGISTER_K4        4\r
+#define IPF_APPLICATION_REGISTER_K5        5\r
+#define IPF_APPLICATION_REGISTER_K6        6\r
+#define IPF_APPLICATION_REGISTER_K7        7\r
+#define IPF_APPLICATION_REGISTER_RSC       16\r
+#define IPF_APPLICATION_REGISTER_BSP       17\r
+#define IPF_APPLICATION_REGISTER_BSPSTORE  18\r
+#define IPF_APPLICATION_REGISTER_RNAT      19\r
+#define IPF_APPLICATION_REGISTER_FCR       21\r
+#define IPF_APPLICATION_REGISTER_EFLAG     24\r
+#define IPF_APPLICATION_REGISTER_CSD       25\r
+#define IPF_APPLICATION_REGISTER_SSD       26\r
+#define IPF_APPLICATION_REGISTER_CFLG      27\r
+#define IPF_APPLICATION_REGISTER_FSR       28\r
+#define IPF_APPLICATION_REGISTER_FIR       29\r
+#define IPF_APPLICATION_REGISTER_FDR       30\r
+#define IPF_APPLICATION_REGISTER_CCV       32\r
+#define IPF_APPLICATION_REGISTER_UNAT      36\r
+#define IPF_APPLICATION_REGISTER_FPSR      40\r
+#define IPF_APPLICATION_REGISTER_ITC       44\r
+#define IPF_APPLICATION_REGISTER_PFS       64\r
+#define IPF_APPLICATION_REGISTER_LC        65\r
+#define IPF_APPLICATION_REGISTER_EC        66\r
+\r
+/**\r
+  Reads a 64-bit application register.\r
+\r
+  Reads and returns the application register specified by Index. The valid Index valued are defined\r
+  above in "Related Definitions".\r
+  If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned.  This function is only available on IPF.\r
+\r
+  @param  Index                     The index of the application register to read.\r
+\r
+  @return The application register specified by Index.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadApplicationRegister (\r
+  IN UINT64  Index\r
+  );\r
+\r
+\r
 /**\r
   Determines if the CPU is currently executing in virtual, physical, or mixed mode.\r
 \r
@@ -4886,11 +4855,11 @@ AsmCpuVirtual (
   PAL entry point then the system behavior is undefined.  This function is only\r
   available on IPF.\r
 \r
-  @param PalEntryPoint The PAL procedure calls entry point.\r
-  @param Index                      The PAL procedure Index number.\r
-  @param Arg2                        The 2nd parameter for PAL procedure calls.\r
-  @param Arg3                        The 3rd parameter for PAL procedure calls.\r
-  @param Arg4                        The 4th parameter for PAL procedure calls.\r
+  @param PalEntryPoint  The PAL procedure calls entry point.\r
+  @param Index          The PAL procedure Index number.\r
+  @param Arg2           The 2nd parameter for PAL procedure calls.\r
+  @param Arg3           The 3rd parameter for PAL procedure calls.\r
+  @param Arg4           The 4th parameter for PAL procedure calls.\r
 \r
   @return structure returned from the PAL Call procedure, including the status and return value.\r
 \r
@@ -4906,67 +4875,6 @@ AsmPalCall (
   );\r
 \r
 \r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  NewBsp      A pointer to the new memory location for RSE backing\r
-                      store.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmSwitchStackAndBackingStore (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack,\r
-  IN      VOID                      *NewBsp\r
-  );\r
-\r
-/**\r
-  @todo   This call should be removed after the PalCall\r
-          Instance issue has been fixed.\r
-\r
-  Performs a PAL call using static calling convention.\r
-\r
-  An internal function to perform a PAL call using static calling convention.\r
-\r
-  @param  PalEntryPoint The entry point address of PAL. The address in ar.kr5\r
-                        would be used if this parameter were NULL on input.\r
-  @param  Arg1          The first argument of a PAL call.\r
-  @param  Arg2          The second argument of a PAL call.\r
-  @param  Arg3          The third argument of a PAL call.\r
-  @param  Arg4          The fourth argument of a PAL call.\r
-\r
-  @return The values returned in r8, r9, r10 and r11.\r
-\r
-**/\r
-PAL_CALL_RETURN\r
-PalCallStatic (\r
-  IN      CONST VOID                *PalEntryPoint,\r
-  IN      UINT64                    Arg1,\r
-  IN      UINT64                    Arg2,\r
-  IN      UINT64                    Arg3,\r
-  IN      UINT64                    Arg4\r
-  );\r
-\r
-\r
-\r
 #elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)\r
 ///\r
 /// IA32 and X64 Specific Functions\r