]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2593 6f19259b...
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index fb3ca341312650007d29ead837c633e8e9b91499..5fbcb10d58648b83b63e2582614c8ccbd5c56763 100644 (file)
@@ -159,6 +159,8 @@ StrCpy (
   OUT     CHAR16                    *Destination,
   IN      CONST CHAR16              *Source
   );
+
+
 /**
   Copies one Null-terminated Unicode string with a maximum length to another
   Null-terminated Unicode string with a maximum length and returns the new
@@ -195,6 +197,8 @@ StrnCpy (
   IN      CONST CHAR16              *Source,
   IN      UINTN                     Length
   );
+
+
 /**
   Returns the length of a Null-terminated Unicode string.
 
@@ -217,6 +221,8 @@ EFIAPI
 StrLen (
   IN      CONST CHAR16              *String
   );
+
+
 /**
   Returns the size of a Null-terminated Unicode string in bytes, including the
   Null terminator.
@@ -240,6 +246,8 @@ EFIAPI
 StrSize (
   IN      CONST CHAR16              *String
   );
+
+
 /**
   Compares two Null-terminated Unicode strings, and returns the difference
   between the first mismatched Unicode characters.
@@ -274,6 +282,8 @@ StrCmp (
   IN      CONST CHAR16              *FirstString,
   IN      CONST CHAR16              *SecondString
   );
+
+
 /**
   Compares two Null-terminated Unicode strings with maximum lengths, and
   returns the difference between the first mismatched Unicode characters.
@@ -311,6 +321,8 @@ StrnCmp (
   IN      CONST CHAR16              *SecondString,
   IN      UINTN                     Length
   );
+
+
 /**
   Concatenates one Null-terminated Unicode string to another Null-terminated
   Unicode string, and returns the concatenated Unicode string.
@@ -349,6 +361,8 @@ StrCat (
   IN OUT  CHAR16                    *Destination,
   IN      CONST CHAR16              *Source
   );
+
+
 /**
   Concatenates one Null-terminated Unicode string with a maximum length to the
   end of another Null-terminated Unicode string, and returns the concatenated
@@ -506,6 +520,7 @@ EFIAPI
 StrDecimalToUint64 (
   IN      CONST CHAR16               *String
   );
 
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
@@ -548,6 +563,7 @@ StrHexToUintn (
   IN      CONST CHAR16               *String
   );
 
+
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
 
@@ -589,6 +605,7 @@ StrHexToUint64 (
   IN      CONST CHAR16               *String
   );
 
+
 /**
   Convert one Null-terminated Unicode string to a Null-terminated
   ASCII string and returns the ASCII string.
@@ -626,6 +643,7 @@ UnicodeStrToAsciiStr (
   OUT    CHAR8                           *Destination
   );
 
+
 /**
   Copies one Null-terminated ASCII string to another Null-terminated ASCII
   string and returns the new ASCII string.
@@ -653,6 +671,8 @@ AsciiStrCpy (
   OUT     CHAR8                     *Destination,
   IN      CONST CHAR8               *Source
   );
+
+
 /**
   Copies one Null-terminated ASCII string with a maximum length to another
   Null-terminated ASCII string with a maximum length and returns the new ASCII
@@ -686,6 +706,8 @@ AsciiStrnCpy (
   IN      CONST CHAR8               *Source,
   IN      UINTN                     Length
   );
+
+
 /**
   Returns the length of a Null-terminated ASCII string.
 
@@ -708,6 +730,8 @@ EFIAPI
 AsciiStrLen (
   IN      CONST CHAR8               *String
   );
+
+
 /**
   Returns the size of a Null-terminated ASCII string in bytes, including the
   Null terminator.
@@ -730,6 +754,8 @@ EFIAPI
 AsciiStrSize (
   IN      CONST CHAR8               *String
   );
+
+
 /**
   Compares two Null-terminated ASCII strings, and returns the difference
   between the first mismatched ASCII characters.
@@ -762,6 +788,8 @@ AsciiStrCmp (
   IN      CONST CHAR8               *FirstString,
   IN      CONST CHAR8               *SecondString
   );
+
+
 /**
   Performs a case insensitive comparison of two Null-terminated ASCII strings,
   and returns the difference between the first mismatched ASCII characters.
@@ -797,6 +825,8 @@ AsciiStriCmp (
   IN      CONST CHAR8               *FirstString,
   IN      CONST CHAR8               *SecondString
   );
+
+
 /**
   Compares two Null-terminated ASCII strings with maximum lengths, and returns
   the difference between the first mismatched ASCII characters.
@@ -831,6 +861,8 @@ AsciiStrnCmp (
   IN      CONST CHAR8               *SecondString,
   IN      UINTN                     Length
   );
+
+
 /**
   Concatenates one Null-terminated ASCII string to another Null-terminated
   ASCII string, and returns the concatenated ASCII string.
@@ -864,6 +896,8 @@ AsciiStrCat (
   IN OUT CHAR8    *Destination,
   IN CONST CHAR8  *Source
   );
+
+
 /**
   Concatenates one Null-terminated ASCII string with a maximum length to the
   end of another Null-terminated ASCII string, and returns the concatenated
@@ -906,6 +940,7 @@ AsciiStrnCat (
   IN      UINTN                     Length
   );
 
+
 /**
   Returns the first occurance of a Null-terminated ASCII sub-string
   in a Null-terminated ASCII string.
@@ -936,6 +971,7 @@ AsciiStrStr (
   IN      CONST CHAR8                  *SearchString
   );
 
+
 /**
   Convert a Null-terminated ASCII decimal string to a value of type
   UINTN.
@@ -972,6 +1008,7 @@ AsciiStrDecimalToUintn (
   IN      CONST CHAR8               *String
   );
 
+
 /**
   Convert a Null-terminated ASCII decimal string to a value of type
   UINT64.
@@ -1008,6 +1045,7 @@ AsciiStrDecimalToUint64 (
   IN      CONST CHAR8                *String
   );
 
+
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
 
@@ -1048,6 +1086,7 @@ AsciiStrHexToUintn (
   IN      CONST CHAR8                *String
   );
 
+
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
 
@@ -1088,6 +1127,7 @@ AsciiStrHexToUint64 (
   IN      CONST CHAR8                  *String
   );
 
+
 /**
   Convert one Null-terminated ASCII string to a Null-terminated
   Unicode string and returns the Unicode string.
@@ -1122,6 +1162,7 @@ AsciiStrToUnicodeStr (
   OUT    CHAR16                        *Destination
   );
 
+
 /**
   Converts an 8-bit value to an 8-bit BCD value.
 
@@ -1141,6 +1182,7 @@ DecimalToBcd8 (
   IN      UINT8                     Value
   );
 
+
 /**
   Converts an 8-bit BCD value to an 8-bit value.
 
@@ -1182,6 +1224,7 @@ BcdToDecimal8 (
 **/
 #define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)  {&ListHead, &ListHead}
 
+
 /**
   Initializes the head node of a doubly linked list, and returns the pointer to
   the head node of the doubly linked list.
@@ -1204,6 +1247,7 @@ InitializeListHead (
   IN      LIST_ENTRY                *ListHead
   );
 
+
 /**
   Adds a node to the beginning of a doubly linked list, and returns the pointer
   to the head node of the doubly linked list.
@@ -1232,6 +1276,7 @@ InsertHeadList (
   IN      LIST_ENTRY                *Entry
   );
 
+
 /**
   Adds a node to the end of a doubly linked list, and returns the pointer to
   the head node of the doubly linked list.
@@ -1260,6 +1305,7 @@ InsertTailList (
   IN      LIST_ENTRY                *Entry
   );
 
+
 /**
   Retrieves the first node of a doubly linked list.
 
@@ -1285,6 +1331,7 @@ GetFirstNode (
   IN      CONST LIST_ENTRY          *List
   );
 
+
 /**
   Retrieves the next node of a doubly linked list.
 
@@ -1313,6 +1360,7 @@ GetNextNode (
   IN      CONST LIST_ENTRY          *Node
   );
 
+
 /**
   Checks to see if a doubly linked list is empty or not.
 
@@ -1337,6 +1385,7 @@ IsListEmpty (
   IN      CONST LIST_ENTRY          *ListHead
   );
 
+
 /**
   Determines if a node in a doubly linked list is null.
 
@@ -1366,6 +1415,7 @@ IsNull (
   IN      CONST LIST_ENTRY          *Node
   );
 
+
 /**
   Determines if a node the last node in a doubly linked list.
 
@@ -1395,6 +1445,7 @@ IsNodeAtEnd (
   IN      CONST LIST_ENTRY          *Node
   );
 
+
 /**
   Swaps the location of two nodes in a doubly linked list, and returns the
   first node after the swap.
@@ -1425,6 +1476,7 @@ SwapListEntries (
   IN      LIST_ENTRY                *SecondEntry
   );
 
+
 /**
   Removes a node from a doubly linked list, and returns the node that follows
   the removed node.
@@ -1478,6 +1530,7 @@ LShiftU64 (
   IN      UINTN                     Count
   );
 
+
 /**
   Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
   filled with zeros. The shifted value is returned.
@@ -1500,6 +1553,7 @@ RShiftU64 (
   IN      UINTN                     Count
   );
 
+
 /**
   Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
   with original integer's bit 63. The shifted value is returned.
@@ -1522,6 +1576,7 @@ ARShiftU64 (
   IN      UINTN                     Count
   );
 
+
 /**
   Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
   with the high bits that were rotated.
@@ -1545,6 +1600,7 @@ LRotU32 (
   IN      UINTN                     Count
   );
 
+
 /**
   Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
   with the low bits that were rotated.
@@ -1568,6 +1624,7 @@ RRotU32 (
   IN      UINTN                     Count
   );
 
+
 /**
   Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
   with the high bits that were rotated.
@@ -1591,6 +1648,7 @@ LRotU64 (
   IN      UINTN                     Count
   );
 
+
 /**
   Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
   with the high low bits that were rotated.
@@ -1614,6 +1672,7 @@ RRotU64 (
   IN      UINTN                     Count
   );
 
+
 /**
   Returns the bit position of the lowest bit set in a 32-bit value.
 
@@ -1633,6 +1692,7 @@ LowBitSet32 (
   IN      UINT32                    Operand
   );
 
+
 /**
   Returns the bit position of the lowest bit set in a 64-bit value.
 
@@ -1652,6 +1712,7 @@ LowBitSet64 (
   IN      UINT64                    Operand
   );
 
+
 /**
   Returns the bit position of the highest bit set in a 32-bit value. Equivalent
   to log2(x).
@@ -1672,6 +1733,7 @@ HighBitSet32 (
   IN      UINT32                    Operand
   );
 
+
 /**
   Returns the bit position of the highest bit set in a 64-bit value. Equivalent
   to log2(x).
@@ -1692,6 +1754,7 @@ HighBitSet64 (
   IN      UINT64                    Operand
   );
 
+
 /**
   Returns the value of the highest bit set in a 32-bit value. Equivalent to
   1 << HighBitSet32(x).
@@ -1711,6 +1774,7 @@ GetPowerOfTwo32 (
   IN      UINT32                    Operand
   );
 
+
 /**
   Returns the value of the highest bit set in a 64-bit value. Equivalent to
   1 << HighBitSet64(x).
@@ -1730,6 +1794,7 @@ GetPowerOfTwo64 (
   IN      UINT64                    Operand
   );
 
+
 /**
   Switches the endianess of a 16-bit integer.
 
@@ -1748,6 +1813,7 @@ SwapBytes16 (
   IN      UINT16                    Value
   );
 
+
 /**
   Switches the endianess of a 32-bit integer.
 
@@ -1766,6 +1832,7 @@ SwapBytes32 (
   IN      UINT32                    Value
   );
 
+
 /**
   Switches the endianess of a 64-bit integer.
 
@@ -1784,6 +1851,7 @@ SwapBytes64 (
   IN      UINT64                    Value
   );
 
+
 /**
   Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
   generates a 64-bit unsigned result.
@@ -1807,6 +1875,7 @@ MultU64x32 (
   IN      UINT32                    Multiplier
   );
 
+
 /**
   Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
   generates a 64-bit unsigned result.
@@ -1830,6 +1899,7 @@ MultU64x64 (
   IN      UINT64                    Multiplier
   );
 
+
 /**
   Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
   64-bit signed result.
@@ -1853,6 +1923,7 @@ MultS64x64 (
   IN      INT64                     Multiplier
   );
 
+
 /**
   Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
   a 64-bit unsigned result.
@@ -1876,6 +1947,7 @@ DivU64x32 (
   IN      UINT32                    Divisor
   );
 
+
 /**
   Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
   a 32-bit unsigned remainder.
@@ -1899,6 +1971,7 @@ ModU64x32 (
   IN      UINT32                    Divisor
   );
 
+
 /**
   Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
   a 64-bit unsigned result and an optional 32-bit unsigned remainder.
@@ -1926,6 +1999,7 @@ DivU64x32Remainder (
   OUT     UINT32                    *Remainder  OPTIONAL
   );
 
+
 /**
   Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
   a 64-bit unsigned result and an optional 64-bit unsigned remainder.
@@ -1953,6 +2027,7 @@ DivU64x64Remainder (
   OUT     UINT64                    *Remainder  OPTIONAL
   );
 
+
 /**
   Divides a 64-bit signed integer by a 64-bit signed integer and generates a
   64-bit signed result and a optional 64-bit signed remainder.
@@ -1980,6 +2055,7 @@ DivS64x64Remainder (
   OUT     INT64                     *Remainder  OPTIONAL
   );
 
+
 /**
   Reads a 16-bit value from memory that may be unaligned.
 
@@ -1999,6 +2075,7 @@ ReadUnaligned16 (
   IN      CONST UINT16              *Uint16
   );
 
+
 /**
   Writes a 16-bit value to memory that may be unaligned.
 
@@ -2021,6 +2098,7 @@ WriteUnaligned16 (
   IN      UINT16                    Value
   );
 
+
 /**
   Reads a 24-bit value from memory that may be unaligned.
 
@@ -2040,6 +2118,7 @@ ReadUnaligned24 (
   IN      CONST UINT32              *Buffer
   );
 
+
 /**
   Writes a 24-bit value to memory that may be unaligned.
 
@@ -2062,6 +2141,7 @@ WriteUnaligned24 (
   IN      UINT32                    Value
   );
 
+
 /**
   Reads a 32-bit value from memory that may be unaligned.
 
@@ -2081,6 +2161,7 @@ ReadUnaligned32 (
   IN      CONST UINT32              *Uint32
   );
 
+
 /**
   Writes a 32-bit value to memory that may be unaligned.
 
@@ -2103,6 +2184,7 @@ WriteUnaligned32 (
   IN      UINT32                    Value
   );
 
+
 /**
   Reads a 64-bit value from memory that may be unaligned.
 
@@ -2122,6 +2204,7 @@ ReadUnaligned64 (
   IN      CONST UINT64              *Uint64
   );
 
+
 /**
   Writes a 64-bit value to memory that may be unaligned.
 
@@ -2144,6 +2227,7 @@ WriteUnaligned64 (
   IN      UINT64                    Value
   );
 
+
 //
 // Bit Field Functions
 //
@@ -2175,6 +2259,7 @@ BitFieldRead8 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to an 8-bit value, and returns the result.
 
@@ -2206,6 +2291,7 @@ BitFieldWrite8 (
   IN      UINT8                     Value
   );
 
+
 /**
   Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
   result.
@@ -2238,6 +2324,7 @@ BitFieldOr8 (
   IN      UINT8                     OrData
   );
 
+
 /**
   Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
   the result.
@@ -2270,6 +2357,7 @@ BitFieldAnd8 (
   IN      UINT8                     AndData
   );
 
+
 /**
   Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
   bitwise OR, and returns the result.
@@ -2305,6 +2393,7 @@ BitFieldAndThenOr8 (
   IN      UINT8                     OrData
   );
 
+
 /**
   Returns a bit field from a 16-bit value.
 
@@ -2332,6 +2421,7 @@ BitFieldRead16 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to a 16-bit value, and returns the result.
 
@@ -2363,6 +2453,7 @@ BitFieldWrite16 (
   IN      UINT16                    Value
   );
 
+
 /**
   Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
   result.
@@ -2395,6 +2486,7 @@ BitFieldOr16 (
   IN      UINT16                    OrData
   );
 
+
 /**
   Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
   the result.
@@ -2427,6 +2519,7 @@ BitFieldAnd16 (
   IN      UINT16                    AndData
   );
 
+
 /**
   Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
   bitwise OR, and returns the result.
@@ -2462,6 +2555,7 @@ BitFieldAndThenOr16 (
   IN      UINT16                    OrData
   );
 
+
 /**
   Returns a bit field from a 32-bit value.
 
@@ -2489,6 +2583,7 @@ BitFieldRead32 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to a 32-bit value, and returns the result.
 
@@ -2520,6 +2615,7 @@ BitFieldWrite32 (
   IN      UINT32                    Value
   );
 
+
 /**
   Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
   result.
@@ -2552,6 +2648,7 @@ BitFieldOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
   the result.
@@ -2584,6 +2681,7 @@ BitFieldAnd32 (
   IN      UINT32                    AndData
   );
 
+
 /**
   Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
   bitwise OR, and returns the result.
@@ -2619,6 +2717,7 @@ BitFieldAndThenOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Returns a bit field from a 64-bit value.
 
@@ -2646,6 +2745,7 @@ BitFieldRead64 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to a 64-bit value, and returns the result.
 
@@ -2677,6 +2777,7 @@ BitFieldWrite64 (
   IN      UINT64                    Value
   );
 
+
 /**
   Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
   result.
@@ -2709,6 +2810,7 @@ BitFieldOr64 (
   IN      UINT64                    OrData
   );
 
+
 /**
   Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
   the result.
@@ -2741,6 +2843,7 @@ BitFieldAnd64 (
   IN      UINT64                    AndData
   );
 
+
 /**
   Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
   bitwise OR, and returns the result.
@@ -2776,6 +2879,7 @@ BitFieldAndThenOr64 (
   IN      UINT64                    OrData
   );
 
+
 //
 // Base Library Synchronization Functions
 //
@@ -2802,6 +2906,7 @@ GetSpinLockProperties (
   VOID
   );
 
+
 /**
   Initializes a spin lock to the released state and returns the spin lock.
 
@@ -2824,6 +2929,7 @@ InitializeSpinLock (
   IN      SPIN_LOCK                 *SpinLock
   );
 
+
 /**
   Waits until a spin lock can be placed in the acquired state.
 
@@ -2850,6 +2956,7 @@ AcquireSpinLock (
   IN      SPIN_LOCK                 *SpinLock
   );
 
+
 /**
   Attempts to place a spin lock in the acquired state.
 
@@ -2873,6 +2980,7 @@ AcquireSpinLockOrFail (
   IN      SPIN_LOCK                 *SpinLock
   );
 
+
 /**
   Releases a spin lock.
 
@@ -2893,6 +3001,7 @@ ReleaseSpinLock (
   IN      SPIN_LOCK                 *SpinLock
   );
 
+
 /**
   Performs an atomic increment of an 32-bit unsigned integer.
 
@@ -2914,6 +3023,7 @@ InterlockedIncrement (
   IN      UINT32                    *Value
   );
 
+
 /**
   Performs an atomic decrement of an 32-bit unsigned integer.
 
@@ -2935,6 +3045,7 @@ InterlockedDecrement (
   IN      UINT32                    *Value
   );
 
+
 /**
   Performs an atomic compare exchange operation on a 32-bit unsigned integer.
 
@@ -2962,6 +3073,7 @@ InterlockedCompareExchange32 (
   IN      UINT32                    ExchangeValue
   );
 
+
 /**
   Performs an atomic compare exchange operation on a 64-bit unsigned integer.
 
@@ -2988,6 +3100,7 @@ InterlockedCompareExchange64 (
   IN      UINT64                    ExchangeValue
   );
 
+
 /**
   Performs an atomic compare exchange operation on a pointer value.
 
@@ -3013,6 +3126,7 @@ InterlockedCompareExchangePointer (
   IN      VOID                      *ExchangeValue
   );
 
+
 //
 // Base Library Checksum Functions
 //
@@ -3069,6 +3183,7 @@ CalculateCheckSum8 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the sum of all elements in a buffer of 16-bit values.  During
   calculation, the carry bits are dropped.
@@ -3095,6 +3210,7 @@ CalculateSum16 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the two's complement checksum of all elements in a buffer of
   16-bit values.
@@ -3122,6 +3238,7 @@ CalculateCheckSum16 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the sum of all elements in a buffer of 32-bit values.  During
   calculation, the carry bits are dropped.
@@ -3148,6 +3265,7 @@ CalculateSum32 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the two's complement checksum of all elements in a buffer of
   32-bit values.
@@ -3175,6 +3293,7 @@ CalculateCheckSum32 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the sum of all elements in a buffer of 64-bit values.  During
   calculation, the carry bits are dropped.
@@ -3201,6 +3320,7 @@ CalculateSum64 (
   IN      UINTN                                      Length
   );
 
+
 /**
   Returns the two's complement checksum of all elements in a buffer of
   64-bit values.
@@ -3228,6 +3348,7 @@ CalculateCheckSum64 (
   IN      UINTN                                      Length
   );
 
+
 //
 // Base Library CPU Functions
 //
@@ -3238,6 +3359,7 @@ VOID
   IN      VOID                      *Context2   OPTIONAL
   );
 
+
 /**
   Used to serialize load and store operations.
 
@@ -3251,6 +3373,7 @@ MemoryFence (
   VOID
   );
 
+
 /**
   Saves the current CPU context that can be restored with a call to LongJump()
   and returns 0.
@@ -3273,6 +3396,7 @@ SetJump (
   OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
   );
 
+
 /**
   Restores the CPU context that was saved with SetJump().
 
@@ -3296,6 +3420,7 @@ LongJump (
   IN      UINTN                     Value
   );
 
+
 /**
   Enables CPU interrupts.
 
@@ -3308,6 +3433,7 @@ EnableInterrupts (
   VOID
   );
 
+
 /**
   Disables CPU interrupts.
 
@@ -3320,6 +3446,7 @@ DisableInterrupts (
   VOID
   );
 
+
 /**
   Disables CPU interrupts and returns the interrupt state prior to the disable
   operation.
@@ -3337,6 +3464,7 @@ SaveAndDisableInterrupts (
   VOID
   );
 
+
 /**
   Enables CPU interrupts for the smallest window required to capture any
   pending interrupts.
@@ -3351,6 +3479,7 @@ EnableDisableInterrupts (
   VOID
   );
 
+
 /**
   Retrieves the current CPU interrupt state.
 
@@ -3367,6 +3496,7 @@ GetInterruptState (
   VOID
   );
 
+
 /**
   Set the current CPU interrupt state.
 
@@ -3387,6 +3517,7 @@ SetInterruptState (
   IN      BOOLEAN                   InterruptState
   );
 
+
 /**
   Places the CPU in a sleep state until an interrupt is received.
 
@@ -3401,6 +3532,7 @@ CpuSleep (
   VOID
   );
 
+
 /**
   Requests CPU to pause for a short period of time.
 
@@ -3414,6 +3546,7 @@ CpuPause (
   VOID
   );
 
+
 /**
   Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
 
@@ -3426,6 +3559,7 @@ CpuFlushTlb (
   VOID
   );
 
+
 /**
   Transfers control to a function starting with a new stack.
 
@@ -3460,6 +3594,7 @@ SwitchStack (
   ...
   );
 
+
 /**
   Generates a breakpoint on the CPU.
 
@@ -3473,6 +3608,7 @@ CpuBreakpoint (
   VOID
   );
 
+
 /**
   Executes an infinite loop.
 
@@ -3488,119 +3624,1350 @@ CpuDeadLoop (
   VOID
   );
 
-//
-// IA32 and X64 Specific Functions
-//
-//
-// Byte packed structure for 16-bit Real Mode EFLAGS
-//
-typedef union {
-  struct {
-    UINT32  CF:1;           // Carry Flag
-    UINT32  Reserved_0:1;   // Reserved
-    UINT32  PF:1;           // Parity Flag
-    UINT32  Reserved_1:1;   // Reserved
-    UINT32  AF:1;           // Auxiliary Carry Flag
-    UINT32  Reserved_2:1;   // Reserved
-    UINT32  ZF:1;           // Zero Flag
-    UINT32  SF:1;           // Sign Flag
-    UINT32  TF:1;           // Trap Flag
-    UINT32  IF:1;           // Interrupt Enable Flag
-    UINT32  DF:1;           // Direction Flag
-    UINT32  OF:1;           // Overflow Flag
-    UINT32  IOPL:2;         // I/O Privilege Level
-    UINT32  NT:1;           // Nested Task
-    UINT32  Reserved_3:1;   // Reserved
-  } Bits;
-  UINT16    Uint16;
-} IA32_FLAGS16;
 
-//
-// Byte packed structure for EFLAGS/RFLAGS
-// 32-bits on IA-32
-// 64-bits on X64.  The upper 32-bits on X64 are reserved
-//
-typedef union {
-  struct {
-    UINT32  CF:1;           // Carry Flag
-    UINT32  Reserved_0:1;   // Reserved
-    UINT32  PF:1;           // Parity Flag
-    UINT32  Reserved_1:1;   // Reserved
-    UINT32  AF:1;           // Auxiliary Carry Flag
-    UINT32  Reserved_2:1;   // Reserved
-    UINT32  ZF:1;           // Zero Flag
-    UINT32  SF:1;           // Sign Flag
-    UINT32  TF:1;           // Trap Flag
-    UINT32  IF:1;           // Interrupt Enable Flag
-    UINT32  DF:1;           // Direction Flag
-    UINT32  OF:1;           // Overflow Flag
-    UINT32  IOPL:2;         // I/O Privilege Level
-    UINT32  NT:1;           // Nested Task
-    UINT32  Reserved_3:1;   // Reserved
-    UINT32  RF:1;           // Resume Flag
-    UINT32  VM:1;           // Virtual 8086 Mode
-    UINT32  AC:1;           // Alignment Check
-    UINT32  VIF:1;          // Virtual Interrupt Flag
-    UINT32  VIP:1;          // Virtual Interrupt Pending
-    UINT32  ID:1;           // ID Flag
-    UINT32  Reserved_4:10;  // Reserved
-  } Bits;
-  UINTN     UintN;
-} IA32_EFLAGS32;
+#if defined (MDE_CPU_IPF)
 
-//
-// Byte packed structure for Control Register 0 (CR0)
-// 32-bits on IA-32
-// 64-bits on X64.  The upper 32-bits on X64 are reserved
-//
-typedef union {
-  struct {
-    UINT32  PE:1;           // Protection Enable
-    UINT32  MP:1;           // Monitor Coprocessor
-    UINT32  EM:1;           // Emulation
-    UINT32  TS:1;           // Task Switched
-    UINT32  ET:1;           // Extension Type
-    UINT32  NE:1;           // Numeric Error
-    UINT32  Reserved_0:10;  // Reserved
-    UINT32  WP:1;           // Write Protect
-    UINT32  Reserved_1:1;   // Reserved
-    UINT32  AM:1;           // Alignment Mask
-    UINT32  Reserved_2:10;  // Reserved
-    UINT32  NW:1;           // Mot Write-through
-    UINT32  CD:1;           // Cache Disable
-    UINT32  PG:1;           // Paging
-  } Bits;
-  UINTN     UintN;
-} IA32_CR0;
+/**
+  Flush a range of  cache lines in the cache coherency domain of the calling
+  CPU.
 
-//
-// Byte packed structure for Control Register 4 (CR4)
-// 32-bits on IA-32
-// 64-bits on X64.  The upper 32-bits on X64 are reserved
-//
-typedef union {
-  struct {
-    UINT32  VME:1;          // Virtual-8086 Mode Extensions
-    UINT32  PVI:1;          // Protected-Mode Virtual Interrupts
-    UINT32  TSD:1;          // Time Stamp Disable
-    UINT32  DE:1;           // Debugging Extensions
-    UINT32  PSE:1;          // Page Size Extensions
-    UINT32  PAE:1;          // Physical Address Extension
-    UINT32  MCE:1;          // Machine Check Enable
-    UINT32  PGE:1;          // Page Global Enable
-    UINT32  PCE:1;          // Performance Monitoring Counter
-                            // Enable
-    UINT32  OSFXSR:1;       // Operating System Support for
-                            // FXSAVE and FXRSTOR instructions
-    UINT32  OSXMMEXCPT:1;   // Operating System Support for
-                            // Unmasked SIMD Floating Point
-                            // Exceptions
-    UINT32  Reserved_0:2;   // Reserved
-    UINT32  VMXE:1;         // VMX Enable
-    UINT32  Reserved_1:18;  // Reseved
-  } Bits;
-  UINTN     UintN;
-} IA32_CR4;
+  Invalidates the  cache lines specified by Address and Length. If Address is
+  not aligned on a cache line boundary, then entire cache line containing
+  Address is invalidated. If Address + Length is not aligned on a cache line
+  boundary, then the entire instruction cache line containing Address + Length
+  -1 is invalidated. This function may choose to invalidate the entire
+  instruction cache if that is more efficient than invalidating the specified
+  range. If Length is 0, the no instruction cache lines are invalidated.
+  Address is returned.
+
+  If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
+
+  @param  Address The base address of the instruction lines to invalidate. If
+                  the CPU is in a physical addressing mode, then Address is a
+                  physical address. If the CPU is in a virtual addressing mode,
+                  then Address is a virtual address.
+
+  @param  Length  The number of bytes to invalidate from the instruction cache.
+
+  @return Address
+
+**/
+VOID *
+EFIAPI
+IpfFlushCacheRange (
+  IN      VOID                      *Address,
+  IN      UINTN                     Length
+  );
+
+
+/**
+  Executes a FC instruction
+  Executes a FC instruction on the cache line specified by Address.
+  The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
+  An implementation may flush a larger region.  This function is only available on IPF.
+
+  @param Address       The Address of cache line to be flushed.
+
+  @return The address of FC instruction executed.
+
+**/
+UINT64
+EFIAPI
+AsmFc (
+  IN  UINT64  Address
+  );
+
+
+/**
+  Executes a FC.I instruction.
+  Executes a FC.I instruction on the cache line specified by Address.
+  The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
+  An implementation may flush a larger region.  This function is only available on IPF.
+
+  @param Address       The Address of cache line to be flushed.
+
+  @return The address of FC.I instruction executed.
+
+**/
+UINT64
+EFIAPI
+AsmFci (
+  IN  UINT64  Address
+  );
+
+
+/**
+  Reads the current value of a Processor Identifier Register (CPUID).
+  The Index of largest implemented CPUID (One less than the number of implemented CPUID
+  registers) is determined by CPUID [3] bits {7:0}.
+  No parameter checking is performed on Index.  If the Index value is beyond the
+  implemented CPUID register range, a Reserved Register/Field fault may occur.  The caller
+  must either guarantee that Index is valid, or the caller must set up fault handlers to
+  catch the faults.  This function is only available on IPF.
+
+  @param Index         The 8-bit Processor Identifier Register index to read.
+
+  @return The current value of Processor Identifier Register specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadCpuid (
+  IN  UINT8   Index
+  );
+
+
+/**
+  Reads the current value of 64-bit Processor Status Register (PSR).
+  This function is only available on IPF.
+
+  @return The current value of PSR.
+
+**/
+UINT64
+EFIAPI
+AsmReadPsr (
+  VOID
+  );
+
+
+/**
+  Writes the current value of 64-bit Processor Status Register (PSR).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of PSR must be 0 or a Reserved Register/Field fault may occur.  The caller must either guarantee that Value is valid, or the caller must set up fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to PSR.
+
+  @return The 64-bit value written to the PSR.
+
+**/
+UINT64
+EFIAPI
+AsmWritePsr (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #0 (KR0).
+  This function is only available on IPF.
+
+  @return The current value of KR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr0 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #1 (KR1).
+  This function is only available on IPF.
+
+  @return The current value of KR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr1 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #2 (KR2).
+  This function is only available on IPF.
+
+  @return The current value of KR2.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr2 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #3 (KR3).
+  This function is only available on IPF.
+
+  @return The current value of KR3.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr3 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #4 (KR4).
+  This function is only available on IPF.
+
+  @return The current value of KR4.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr4 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #5 (KR5).
+  This function is only available on IPF.
+
+  @return The current value of KR5.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr5 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #6 (KR6).
+  This function is only available on IPF.
+
+  @return The current value of KR6.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr6 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of 64-bit Kernel Register #7 (KR7).
+  This function is only available on IPF.
+
+  @return The current value of KR7.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr7 (
+  VOID
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #0 (KR0).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR0.
+
+  @return The 64-bit value written to the KR0.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr0 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #1 (KR1).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR1.
+
+  @return The 64-bit value written to the KR1.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr1 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #2 (KR2).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR2.
+
+  @return The 64-bit value written to the KR2.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr2 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #3 (KR3).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR3.
+
+  @return The 64-bit value written to the KR3.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr3 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #4 (KR4).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR4.
+
+  @return The 64-bit value written to the KR4.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr4 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #5 (KR5).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR5.
+
+  @return The 64-bit value written to the KR5.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr5 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #6 (KR6).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR6.
+
+  @return The 64-bit value written to the KR6.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr6 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Write the current value of 64-bit Kernel Register #7 (KR7).
+  This function is only available on IPF.
+
+  @param  Value        The 64-bit value to write to KR7.
+
+  @return The 64-bit value written to the KR7.
+
+**/
+UINT64
+EFIAPI
+AsmWriteKr7 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of Interval Timer Counter Register (ITC).
+  This function is only available on IPF.
+
+  @return The current value of ITC.
+
+**/
+UINT64
+EFIAPI
+AsmReadItc (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Interval Timer Vector Register (ITV).
+  This function is only available on IPF.
+
+  @return The current value of ITV.
+
+**/
+UINT64
+EFIAPI
+AsmReadItv (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Interval Timer Match Register (ITM).
+  This function is only available on IPF.
+
+  @return The current value of ITM.
+**/
+UINT64
+EFIAPI
+AsmReadItm (
+  VOID
+  );
+
+
+/**
+  Writes the current value of 64-bit Interval Timer Counter Register (ITC).
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to ITC.
+
+  @return The 64-bit value written to the ITC.
+
+**/
+UINT64
+EFIAPI
+AsmWriteItc (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Interval Timer Match Register (ITM).
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to ITM.
+
+  @return The 64-bit value written to the ITM.
+
+**/
+UINT64
+EFIAPI
+AsmWriteItm (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Interval Timer Vector Register (ITV).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of ITV must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to ITV.
+
+  @return The 64-bit value written to the ITV.
+
+**/
+UINT64
+EFIAPI
+AsmWriteItv (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of Default Control Register (DCR).
+  This function is only available on IPF.
+
+  @return The current value of DCR.
+
+**/
+UINT64
+EFIAPI
+AsmReadDcr (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Interruption Vector Address Register (IVA).
+  This function is only available on IPF.
+
+  @return The current value of IVA.
+**/
+UINT64
+EFIAPI
+AsmReadIva (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Page Table Address Register (PTA).
+  This function is only available on IPF.
+
+  @return The current value of PTA.
+
+**/
+UINT64
+EFIAPI
+AsmReadPta (
+  VOID
+  );
+
+
+/**
+  Writes the current value of 64-bit Default Control Register (DCR).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to DCR.
+
+  @return The 64-bit value written to the DCR.
+
+**/
+UINT64
+EFIAPI
+AsmWriteDcr (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Interruption Vector Address Register (IVA).
+  The size of vector table is 32 K bytes and is 32 K bytes aligned
+  the low 15 bits of Value is ignored when written.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to IVA.
+
+  @return The 64-bit value written to the IVA.
+
+**/
+UINT64
+EFIAPI
+AsmWriteIva (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Page Table Address Register (PTA).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to PTA.
+
+  @return The 64-bit value written to the PTA.
+**/
+UINT64
+EFIAPI
+AsmWritePta (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of Local Interrupt ID Register (LID).
+  This function is only available on IPF.
+
+  @return The current value of LID.
+
+**/
+UINT64
+EFIAPI
+AsmReadLid (
+  VOID
+  );
+
+
+/**
+  Reads the current value of External Interrupt Vector Register (IVR).
+  This function is only available on IPF.
+
+  @return The current value of IVR.
+
+**/
+UINT64
+EFIAPI
+AsmReadIvr (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Task Priority Register (TPR).
+  This function is only available on IPF.
+
+  @return The current value of TPR.
+
+**/
+UINT64
+EFIAPI
+AsmReadTpr (
+  VOID
+  );
+
+
+/**
+  Reads the current value of External Interrupt Request Register #0 (IRR0).
+  This function is only available on IPF.
+
+  @return The current value of IRR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr0 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of External Interrupt Request Register #1 (IRR1).
+  This function is only available on IPF.
+
+  @return The current value of IRR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr1 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of External Interrupt Request Register #2 (IRR2).
+  This function is only available on IPF.
+
+  @return The current value of IRR2.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr2 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of External Interrupt Request Register #3 (IRR3).
+  This function is only available on IPF.
+
+  @return The current value of IRR3.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr3 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Performance Monitor Vector Register (PMV).
+  This function is only available on IPF.
+
+  @return The current value of PMV.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmv (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Corrected Machine Check Vector Register (CMCV).
+  This function is only available on IPF.
+
+  @return The current value of CMCV.
+
+**/
+UINT64
+EFIAPI
+AsmReadCmcv (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Local Redirection Register #0 (LRR0).
+  This function is only available on IPF.
+
+  @return The current value of LRR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadLrr0 (
+  VOID
+  );
+
+
+/**
+  Reads the current value of Local Redirection Register #1 (LRR1).
+  This function is only available on IPF.
+
+  @return The current value of LRR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadLrr1 (
+  VOID
+  );
+
+
+/**
+  Writes the current value of 64-bit Page Local Interrupt ID Register (LID).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of LID must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to LID.
+
+  @return The 64-bit value written to the LID.
+
+**/
+UINT64
+EFIAPI
+AsmWriteLid (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Task Priority Register (TPR).
+  No parameter checking is performed on Value.  All bits of Value corresponding to
+  reserved fields of TPR must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to TPR.
+
+  @return The 64-bit value written to the TPR.
+
+**/
+UINT64
+EFIAPI
+AsmWriteTpr (
+  IN UINT64  Value
+  );
+
+
+/**
+  Performs a write operation on End OF External Interrupt Register (EOI).
+  Writes a value of 0 to the EOI Register.  This function is only available on IPF.
+
+**/
+VOID
+EFIAPI
+AsmWriteEoi (
+  VOID
+  );
+
+
+/**
+  Writes the current value of 64-bit Performance Monitor Vector Register (PMV).
+  No parameter checking is performed on Value.  All bits of Value corresponding
+  to reserved fields of PMV must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to PMV.
+
+  @return The 64-bit value written to the PMV.
+
+**/
+UINT64
+EFIAPI
+AsmWritePmv (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Corrected Machine Check Vector Register (CMCV).
+  No parameter checking is performed on Value.  All bits of Value corresponding
+  to reserved fields of CMCV must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to CMCV.
+
+  @return The 64-bit value written to the CMCV.
+
+**/
+UINT64
+EFIAPI
+AsmWriteCmcv (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Local Redirection Register #0 (LRR0).
+  No parameter checking is performed on Value.  All bits of Value corresponding
+  to reserved fields of LRR0 must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to LRR0.
+
+  @return The 64-bit value written to the LRR0.
+
+**/
+UINT64
+EFIAPI
+AsmWriteLrr0 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Local Redirection Register #1 (LRR1).
+  No parameter checking is performed on Value.  All bits of Value corresponding
+  to reserved fields of LRR1 must be 0 or a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Value is valid, or the caller must
+  set up fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Value         The 64-bit value to write to LRR1.
+
+  @return The 64-bit value written to the LRR1.
+
+**/
+UINT64
+EFIAPI
+AsmWriteLrr1 (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of Instruction Breakpoint Register (IBR).
+  
+  The Instruction Breakpoint Registers are used in pairs.  The even numbered
+  registers contain breakpoint addresses, and the odd numbered registers contain
+  breakpoint mask conditions.  At least 4 instruction registers pairs are implemented
+  on all processor models.   Implemented registers are contiguous starting with
+  register 0.  No parameter checking is performed on Index, and if the Index value
+  is beyond the implemented IBR register range, a Reserved Register/Field fault may
+  occur.  The caller must either guarantee that Index is valid, or the caller must
+  set up fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Instruction Breakpoint Register index to read.
+
+  @return The current value of Instruction Breakpoint Register specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadIbr (
+  IN  UINT8   Index
+  );
+
+
+/**
+  Reads the current value of Data Breakpoint Register (DBR).
+
+  The Data Breakpoint Registers are used in pairs.  The even numbered registers
+  contain breakpoint addresses, and odd numbered registers contain breakpoint
+  mask conditions.  At least 4 data registers pairs are implemented on all processor
+  models.  Implemented registers are contiguous starting with register 0.
+  No parameter checking is performed on Index.  If the Index value is beyond
+  the implemented DBR register range, a Reserved Register/Field fault may occur.
+  The caller must either guarantee that Index is valid, or the caller must set up
+  fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Data Breakpoint Register index to read.
+
+  @return The current value of Data Breakpoint Register specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadDbr (
+  IN  UINT8   Index
+  );
+
+
+/**
+  Reads the current value of Performance Monitor Configuration Register (PMC).
+
+  All processor implementations provide at least 4 performance counters
+  (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow
+  status registers (PMC [0]¡­ PMC [3]).  Processor implementations may provide
+  additional implementation-dependent PMC and PMD to increase the number of
+  Â¡Â®generic¡¯ performance counters (PMC/PMD pairs).  The remainder of PMC and PMD
+  register set is implementation dependent.  No parameter checking is performed
+  on Index.  If the Index value is beyond the implemented PMC register range,
+  zero value will be returned.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Performance Monitor Configuration Register index to read.
+
+  @return The current value of Performance Monitor Configuration Register
+  specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmc (
+  IN  UINT8   Index
+  );
+
+
+/**
+  Reads the current value of Performance Monitor Data Register (PMD).
+
+  All processor implementations provide at least 4 performance counters
+  (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter
+  overflow status registers (PMC [0]¡­ PMC [3]).  Processor implementations may
+  provide additional implementation-dependent PMC and PMD to increase the number
+  of Â¡Â®generic¡¯ performance counters (PMC/PMD pairs).  The remainder of PMC and PMD
+  register set is implementation dependent.  No parameter checking is performed
+  on Index.  If the Index value is beyond the implemented PMD register range,
+  zero value will be returned.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Performance Monitor Data Register index to read.
+
+  @return The current value of Performance Monitor Data Register specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmd (
+  IN  UINT8   Index
+  );
+
+
+/**
+  Writes the current value of 64-bit Instruction Breakpoint Register (IBR).
+
+  Writes current value of Instruction Breakpoint Register specified by Index.
+  The Instruction Breakpoint Registers are used in pairs.  The even numbered
+  registers contain breakpoint addresses, and odd numbered registers contain
+  breakpoint mask conditions.  At least 4 instruction registers pairs are implemented
+  on all processor models.  Implemented registers are contiguous starting with
+  register 0.  No parameter checking is performed on Index.  If the Index value
+  is beyond the implemented IBR register range, a Reserved Register/Field fault may
+  occur.  The caller must either guarantee that Index is valid, or the caller must
+  set up fault handlers to catch the faults.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Instruction Breakpoint Register index to write.
+  @param Value         The 64-bit value to write to IBR.
+
+  @return The 64-bit value written to the IBR.
+
+**/
+UINT64
+EFIAPI
+AsmWriteIbr (
+  IN UINT8   Index,
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Data Breakpoint Register (DBR).
+
+  Writes current value of Data Breakpoint Register specified by Index.
+  The Data Breakpoint Registers are used in pairs.  The even numbered registers
+  contain breakpoint addresses, and odd numbered registers contain breakpoint
+  mask conditions.  At least 4 data registers pairs are implemented on all processor
+  models.  Implemented registers are contiguous starting with register 0.  No parameter
+  checking is performed on Index.  If the Index value is beyond the implemented
+  DBR register range, a Reserved Register/Field fault may occur.  The caller must
+  either guarantee that Index is valid, or the caller must set up fault handlers to
+  catch the faults.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Data Breakpoint Register index to write.
+  @param Value         The 64-bit value to write to DBR.
+
+  @return The 64-bit value written to the DBR.
+
+**/
+UINT64
+EFIAPI
+AsmWriteDbr (
+  IN UINT8   Index,
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Performance Monitor Configuration Register (PMC).
+
+  Writes current value of Performance Monitor Configuration Register specified by Index.
+  All processor implementations provide at least 4 performance counters
+  (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow status
+  registers (PMC [0]¡­ PMC [3]).  Processor implementations may provide additional
+  implementation-dependent PMC and PMD to increase the number of Â¡Â®generic¡¯ performance
+  counters (PMC/PMD pairs).  The remainder of PMC and PMD register set is implementation
+  dependent.  No parameter checking is performed on Index.  If the Index value is
+  beyond the implemented PMC register range, the write is ignored.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Performance Monitor Configuration Register index to write.
+  @param Value         The 64-bit value to write to PMC.
+
+  @return The 64-bit value written to the PMC.
+
+**/
+UINT64
+EFIAPI
+AsmWritePmc (
+  IN UINT8   Index,
+  IN UINT64  Value
+  );
+
+
+/**
+  Writes the current value of 64-bit Performance Monitor Data Register (PMD).
+
+  Writes current value of Performance Monitor Data Register specified by Index.
+  All processor implementations provide at least 4 performance counters
+  (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow
+  status registers (PMC [0]¡­ PMC [3]).  Processor implementations may provide
+  additional implementation-dependent PMC and PMD to increase the number of Â¡Â®generic¡¯
+  performance counters (PMC/PMD pairs).  The remainder of PMC and PMD register set
+  is implementation dependent.  No parameter checking is performed on Index.  If the
+  Index value is beyond the implemented PMD register range, the write is ignored.
+  This function is only available on IPF.
+
+  @param Index         The 8-bit Performance Monitor Data Register index to write.
+  @param Value         The 64-bit value to write to PMD.
+
+  @return The 64-bit value written to the PMD.
+
+**/
+UINT64
+EFIAPI
+AsmWritePmd (
+  IN UINT8   Index,
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of 64-bit Global Pointer (GP).
+
+  Reads and returns the current value of GP.
+  This function is only available on IPF.
+
+  @return The current value of GP.
+
+**/
+UINT64
+EFIAPI
+AsmReadGp (
+  VOID
+  );
+
+
+/**
+  Write the current value of 64-bit Global Pointer (GP).
+
+  Writes the current value of GP. The 64-bit value written to the GP is returned.
+  No parameter checking is performed on Value.
+  This function is only available on IPF.
+
+  @param Value  The 64-bit value to write to GP.
+
+  @return The 64-bit value written to the GP.
+
+**/
+UINT64
+EFIAPI
+AsmWriteGp (
+  IN UINT64  Value
+  );
+
+
+/**
+  Reads the current value of 64-bit Stack Pointer (SP).
+
+  Reads and returns the current value of SP.
+  This function is only available on IPF.
+
+  @return The current value of SP.
+
+**/
+UINT64
+EFIAPI
+AsmReadSp (
+  VOID
+  );
+
+
+/**
+  Determines if the CPU is currently executing in virtual, physical, or mixed mode.
+
+  Determines the current execution mode of the CPU.
+  If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned.
+  If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned.
+  If the CPU is not in physical mode or virtual mode, then it is in mixed mode,
+  and -1 is returned.
+  This function is only available on IPF.
+
+  @return  1  The CPU is in virtual mode.
+  @return  0  The CPU is in physical mode.
+  @return -1  The CPU is in mixed mode.
+
+**/
+INT64
+EFIAPI
+AsmCpuVirtual (
+  VOID
+  );
+
+
+/**
+  Makes a PAL procedure call.
+
+  This is a wrapper function to make a PAL procedure call.  Based on the Index
+  value this API will make static or stacked PAL call.  The following table
+  describes the usage of PAL Procedure Index Assignment. Architected procedures
+  may be designated as required or optional.  If a PAL procedure is specified
+  as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the
+  Status field of the PAL_CALL_RETURN structure.
+  This indicates that the procedure is not present in this PAL implementation.
+  It is the caller¡¯s responsibility to check for this return code after calling
+  any optional PAL procedure.
+  No parameter checking is performed on the 5 input parameters, but there are
+  some common rules that the caller should follow when making a PAL call.  Any
+  address passed to PAL as buffers for return parameters must be 8-byte aligned.
+  Unaligned addresses may cause undefined results.  For those parameters defined
+  as reserved or some fields defined as reserved must be zero filled or the invalid
+  argument return value may be returned or undefined result may occur during the
+  execution of the procedure.  If the PalEntryPoint  does not point to a valid
+  PAL entry point then the system behavior is undefined.  This function is only
+  available on IPF.
+
+  @param PalEntryPoint The PAL procedure calls entry point.
+  @param Index                     The PAL procedure Index number.
+  @param Arg2                        The 2nd parameter for PAL procedure calls.
+  @param Arg3                        The 3rd parameter for PAL procedure calls.
+  @param Arg4                        The 4th parameter for PAL procedure calls.
+
+  @return structure returned from the PAL Call procedure, including the status and return value.
+
+**/
+PAL_CALL_RETURN
+EFIAPI
+AsmPalCall (
+  IN UINT64  PalEntryPoint,
+  IN UINT64  Index,
+  IN UINT64  Arg2,
+  IN UINT64  Arg3,
+  IN UINT64  Arg4
+  );
+
+
+/**
+  Transfers control to a function starting with a new stack.
+
+  Transfers control to the function specified by EntryPoint using the new stack
+  specified by NewStack and passing in the parameters specified by Context1 and
+  Context2. Context1 and Context2 are optional and may be NULL. The function
+  EntryPoint must never return.
+
+  If EntryPoint is NULL, then ASSERT().
+  If NewStack is NULL, then ASSERT().
+
+  @param  EntryPoint  A pointer to function to call with the new stack.
+  @param  Context1    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  Context2    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint
+                      function.
+  @param  NewBsp      A pointer to the new memory location for RSE backing
+                      store.
+
+**/
+VOID
+EFIAPI
+AsmSwitchStackAndBackingStore (
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
+  IN      VOID                      *Context1,  OPTIONAL
+  IN      VOID                      *Context2,  OPTIONAL
+  IN      VOID                      *NewStack,
+  IN      VOID                      *NewBsp
+  );
+
+
+//
+// Bugbug: This call should be removed after
+//         the PalCall Instance issue has been fixed.
+//
+/**
+  Performs a PAL call using static calling convention.
+
+  An internal function to perform a PAL call using static calling convention.
+
+  @param  PalEntryPoint The entry point address of PAL. The address in ar.kr5
+                        would be used if this parameter were NULL on input.
+  @param  Arg1          The first argument of a PAL call.
+  @param  Arg1          The second argument of a PAL call.
+  @param  Arg1          The third argument of a PAL call.
+  @param  Arg1          The fourth argument of a PAL call.
+
+  @return The values returned in r8, r9, r10 and r11.
+
+**/
+PAL_CALL_RETURN
+PalCallStatic (
+  IN      CONST VOID                *PalEntryPoint,
+  IN      UINT64                    Arg1,
+  IN      UINT64                    Arg2,
+  IN      UINT64                    Arg3,
+  IN      UINT64                    Arg4
+  );
+
+
+#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
+//
+// IA32 and X64 Specific Functions
+//
+//
+// Byte packed structure for 16-bit Real Mode EFLAGS
+//
+typedef union {
+  struct {
+    UINT32  CF:1;           // Carry Flag
+    UINT32  Reserved_0:1;   // Reserved
+    UINT32  PF:1;           // Parity Flag
+    UINT32  Reserved_1:1;   // Reserved
+    UINT32  AF:1;           // Auxiliary Carry Flag
+    UINT32  Reserved_2:1;   // Reserved
+    UINT32  ZF:1;           // Zero Flag
+    UINT32  SF:1;           // Sign Flag
+    UINT32  TF:1;           // Trap Flag
+    UINT32  IF:1;           // Interrupt Enable Flag
+    UINT32  DF:1;           // Direction Flag
+    UINT32  OF:1;           // Overflow Flag
+    UINT32  IOPL:2;         // I/O Privilege Level
+    UINT32  NT:1;           // Nested Task
+    UINT32  Reserved_3:1;   // Reserved
+  } Bits;
+  UINT16    Uint16;
+} IA32_FLAGS16;
+
+//
+// Byte packed structure for EFLAGS/RFLAGS
+// 32-bits on IA-32
+// 64-bits on X64.  The upper 32-bits on X64 are reserved
+//
+typedef union {
+  struct {
+    UINT32  CF:1;           // Carry Flag
+    UINT32  Reserved_0:1;   // Reserved
+    UINT32  PF:1;           // Parity Flag
+    UINT32  Reserved_1:1;   // Reserved
+    UINT32  AF:1;           // Auxiliary Carry Flag
+    UINT32  Reserved_2:1;   // Reserved
+    UINT32  ZF:1;           // Zero Flag
+    UINT32  SF:1;           // Sign Flag
+    UINT32  TF:1;           // Trap Flag
+    UINT32  IF:1;           // Interrupt Enable Flag
+    UINT32  DF:1;           // Direction Flag
+    UINT32  OF:1;           // Overflow Flag
+    UINT32  IOPL:2;         // I/O Privilege Level
+    UINT32  NT:1;           // Nested Task
+    UINT32  Reserved_3:1;   // Reserved
+    UINT32  RF:1;           // Resume Flag
+    UINT32  VM:1;           // Virtual 8086 Mode
+    UINT32  AC:1;           // Alignment Check
+    UINT32  VIF:1;          // Virtual Interrupt Flag
+    UINT32  VIP:1;          // Virtual Interrupt Pending
+    UINT32  ID:1;           // ID Flag
+    UINT32  Reserved_4:10;  // Reserved
+  } Bits;
+  UINTN     UintN;
+} IA32_EFLAGS32;
+
+//
+// Byte packed structure for Control Register 0 (CR0)
+// 32-bits on IA-32
+// 64-bits on X64.  The upper 32-bits on X64 are reserved
+//
+typedef union {
+  struct {
+    UINT32  PE:1;           // Protection Enable
+    UINT32  MP:1;           // Monitor Coprocessor
+    UINT32  EM:1;           // Emulation
+    UINT32  TS:1;           // Task Switched
+    UINT32  ET:1;           // Extension Type
+    UINT32  NE:1;           // Numeric Error
+    UINT32  Reserved_0:10;  // Reserved
+    UINT32  WP:1;           // Write Protect
+    UINT32  Reserved_1:1;   // Reserved
+    UINT32  AM:1;           // Alignment Mask
+    UINT32  Reserved_2:10;  // Reserved
+    UINT32  NW:1;           // Mot Write-through
+    UINT32  CD:1;           // Cache Disable
+    UINT32  PG:1;           // Paging
+  } Bits;
+  UINTN     UintN;
+} IA32_CR0;
+
+//
+// Byte packed structure for Control Register 4 (CR4)
+// 32-bits on IA-32
+// 64-bits on X64.  The upper 32-bits on X64 are reserved
+//
+typedef union {
+  struct {
+    UINT32  VME:1;          // Virtual-8086 Mode Extensions
+    UINT32  PVI:1;          // Protected-Mode Virtual Interrupts
+    UINT32  TSD:1;          // Time Stamp Disable
+    UINT32  DE:1;           // Debugging Extensions
+    UINT32  PSE:1;          // Page Size Extensions
+    UINT32  PAE:1;          // Physical Address Extension
+    UINT32  MCE:1;          // Machine Check Enable
+    UINT32  PGE:1;          // Page Global Enable
+    UINT32  PCE:1;          // Performance Monitoring Counter
+                            // Enable
+    UINT32  OSFXSR:1;       // Operating System Support for
+                            // FXSAVE and FXRSTOR instructions
+    UINT32  OSXMMEXCPT:1;   // Operating System Support for
+                            // Unmasked SIMD Floating Point
+                            // Exceptions
+    UINT32  Reserved_0:2;   // Reserved
+    UINT32  VMXE:1;         // VMX Enable
+    UINT32  Reserved_1:18;  // Reseved
+  } Bits;
+  UINTN     UintN;
+} IA32_CR4;
 
 //
 // Byte packed structure for an IDTR, GDTR, LDTR descriptor
@@ -3755,6 +5122,7 @@ AsmCpuid (
   OUT     UINT32                    *Edx   OPTIONAL
   );
 
+
 /**
   Retrieves CPUID information using an extended leaf identifier.
 
@@ -3798,6 +5166,7 @@ AsmCpuidEx (
   OUT     UINT32                    *Edx   OPTIONAL
   );
 
+
 /**
   Returns the lower 32-bits of a Machine Specific Register(MSR).
 
@@ -3818,6 +5187,7 @@ AsmReadMsr32 (
   IN      UINT32                    Index
   );
 
+
 /**
   Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).
 
@@ -3841,6 +5211,7 @@ AsmWriteMsr32 (
   IN      UINT32                    Value
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise inclusive OR on the lower 32-bits, and
   writes the result back to the 64-bit MSR.
@@ -3867,6 +5238,7 @@ AsmMsrOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
   the result back to the 64-bit MSR.
@@ -3893,6 +5265,7 @@ AsmMsrAnd32 (
   IN      UINT32                    AndData
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive OR
   on the lower 32-bits, and writes the result back to the 64-bit MSR.
@@ -3923,6 +5296,7 @@ AsmMsrAndThenOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Reads a bit field of an MSR.
 
@@ -3953,6 +5327,7 @@ AsmMsrBitFieldRead32 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to an MSR.
 
@@ -3987,6 +5362,7 @@ AsmMsrBitFieldWrite32 (
   IN      UINT32                    Value
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
   result back to the bit field in the 64-bit MSR.
@@ -4022,6 +5398,7 @@ AsmMsrBitFieldOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
   result back to the bit field in the 64-bit MSR.
@@ -4057,6 +5434,7 @@ AsmMsrBitFieldAnd32 (
   IN      UINT32                    AndData
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
   bitwise inclusive OR, and writes the result back to the bit field in the
@@ -4096,6 +5474,7 @@ AsmMsrBitFieldAndThenOr32 (
   IN      UINT32                    OrData
   );
 
+
 /**
   Returns a 64-bit Machine Specific Register(MSR).
 
@@ -4116,6 +5495,7 @@ AsmReadMsr64 (
   IN      UINT32                    Index
   );
 
+
 /**
   Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
   value.
@@ -4140,6 +5520,7 @@ AsmWriteMsr64 (
   IN      UINT64                    Value
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise inclusive OR, and writes the result
   back to the 64-bit MSR.
@@ -4165,6 +5546,7 @@ AsmMsrOr64 (
   IN      UINT64                    OrData
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
   64-bit MSR.
@@ -4190,6 +5572,7 @@ AsmMsrAnd64 (
   IN      UINT64                    AndData
   );
 
+
 /**
   Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive
   OR, and writes the result back to the 64-bit MSR.
@@ -4219,6 +5602,7 @@ AsmMsrAndThenOr64 (
   IN      UINT64                    OrData
   );
 
+
 /**
   Reads a bit field of an MSR.
 
@@ -4249,6 +5633,7 @@ AsmMsrBitFieldRead64 (
   IN      UINTN                     EndBit
   );
 
+
 /**
   Writes a bit field to an MSR.
 
@@ -4282,6 +5667,7 @@ AsmMsrBitFieldWrite64 (
   IN      UINT64                    Value
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise inclusive OR, and
   writes the result back to the bit field in the 64-bit MSR.
@@ -4317,6 +5703,7 @@ AsmMsrBitFieldOr64 (
   IN      UINT64                    OrData
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
   result back to the bit field in the 64-bit MSR.
@@ -4352,6 +5739,7 @@ AsmMsrBitFieldAnd64 (
   IN      UINT64                    AndData
   );
 
+
 /**
   Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
   bitwise inclusive OR, and writes the result back to the bit field in the
@@ -4390,6 +5778,7 @@ AsmMsrBitFieldAndThenOr64 (
   IN      UINT64                    OrData
   );
 
+
 /**
   Reads the current value of the EFLAGS register.
 
@@ -4406,6 +5795,7 @@ AsmReadEflags (
   VOID
   );
 
+
 /**
   Reads the current value of the Control Register 0 (CR0).
 
@@ -4422,6 +5812,7 @@ AsmReadCr0 (
   VOID
   );
 
+
 /**
   Reads the current value of the Control Register 2 (CR2).
 
@@ -4438,6 +5829,7 @@ AsmReadCr2 (
   VOID
   );
 
+
 /**
   Reads the current value of the Control Register 3 (CR3).
 
@@ -4454,6 +5846,7 @@ AsmReadCr3 (
   VOID
   );
 
+
 /**
   Reads the current value of the Control Register 4 (CR4).
 
@@ -4470,6 +5863,7 @@ AsmReadCr4 (
   VOID
   );
 
+
 /**
   Writes a value to Control Register 0 (CR0).
 
@@ -4487,6 +5881,7 @@ AsmWriteCr0 (
   UINTN  Cr0
   );
 
+
 /**
   Writes a value to Control Register 2 (CR2).
 
@@ -4504,6 +5899,7 @@ AsmWriteCr2 (
   UINTN  Cr2
   );
 
+
 /**
   Writes a value to Control Register 3 (CR3).
 
@@ -4521,6 +5917,7 @@ AsmWriteCr3 (
   UINTN  Cr3
   );
 
+
 /**
   Writes a value to Control Register 4 (CR4).
 
@@ -4538,6 +5935,7 @@ AsmWriteCr4 (
   UINTN  Cr4
   );
 
+
 /**
   Reads the current value of Debug Register 0 (DR0).
 
@@ -4554,6 +5952,7 @@ AsmReadDr0 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 1 (DR1).
 
@@ -4570,6 +5969,7 @@ AsmReadDr1 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 2 (DR2).
 
@@ -4586,6 +5986,7 @@ AsmReadDr2 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 3 (DR3).
 
@@ -4602,6 +6003,7 @@ AsmReadDr3 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 4 (DR4).
 
@@ -4618,6 +6020,7 @@ AsmReadDr4 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 5 (DR5).
 
@@ -4634,6 +6037,7 @@ AsmReadDr5 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 6 (DR6).
 
@@ -4650,6 +6054,7 @@ AsmReadDr6 (
   VOID
   );
 
+
 /**
   Reads the current value of Debug Register 7 (DR7).
 
@@ -4666,6 +6071,7 @@ AsmReadDr7 (
   VOID
   );
 
+
 /**
   Writes a value to Debug Register 0 (DR0).
 
@@ -4683,6 +6089,7 @@ AsmWriteDr0 (
   UINTN  Dr0
   );
 
+
 /**
   Writes a value to Debug Register 1 (DR1).
 
@@ -4700,6 +6107,7 @@ AsmWriteDr1 (
   UINTN  Dr1
   );
 
+
 /**
   Writes a value to Debug Register 2 (DR2).
 
@@ -4717,6 +6125,7 @@ AsmWriteDr2 (
   UINTN  Dr2
   );
 
+
 /**
   Writes a value to Debug Register 3 (DR3).
 
@@ -4734,6 +6143,7 @@ AsmWriteDr3 (
   UINTN  Dr3
   );
 
+
 /**
   Writes a value to Debug Register 4 (DR4).
 
@@ -4751,6 +6161,7 @@ AsmWriteDr4 (
   UINTN  Dr4
   );
 
+
 /**
   Writes a value to Debug Register 5 (DR5).
 
@@ -4768,6 +6179,7 @@ AsmWriteDr5 (
   UINTN  Dr5
   );
 
+
 /**
   Writes a value to Debug Register 6 (DR6).
 
@@ -4785,6 +6197,7 @@ AsmWriteDr6 (
   UINTN  Dr6
   );
 
+
 /**
   Writes a value to Debug Register 7 (DR7).
 
@@ -4802,6 +6215,7 @@ AsmWriteDr7 (
   UINTN  Dr7
   );
 
+
 /**
   Reads the current value of Code Segment Register (CS).
 
@@ -4817,6 +6231,7 @@ AsmReadCs (
   VOID
   );
 
+
 /**
   Reads the current value of Data Segment Register (DS).
 
@@ -4832,6 +6247,7 @@ AsmReadDs (
   VOID
   );
 
+
 /**
   Reads the current value of Extra Segment Register (ES).
 
@@ -4847,6 +6263,7 @@ AsmReadEs (
   VOID
   );
 
+
 /**
   Reads the current value of FS Data Segment Register (FS).
 
@@ -4862,6 +6279,7 @@ AsmReadFs (
   VOID
   );
 
+
 /**
   Reads the current value of GS Data Segment Register (GS).
 
@@ -4877,6 +6295,7 @@ AsmReadGs (
   VOID
   );
 
+
 /**
   Reads the current value of Stack Segment Register (SS).
 
@@ -4892,6 +6311,7 @@ AsmReadSs (
   VOID
   );
 
+
 /**
   Reads the current value of Task Register (TR).
 
@@ -4907,6 +6327,7 @@ AsmReadTr (
   VOID
   );
 
+
 /**
   Reads the current Global Descriptor Table Register(GDTR) descriptor.
 
@@ -4924,6 +6345,7 @@ AsmReadGdtr (
   OUT     IA32_DESCRIPTOR           *Gdtr
   );
 
+
 /**
   Writes the current Global Descriptor Table Register (GDTR) descriptor.
 
@@ -4941,6 +6363,7 @@ AsmWriteGdtr (
   IN      CONST IA32_DESCRIPTOR     *Gdtr
   );
 
+
 /**
   Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
 
@@ -4958,6 +6381,7 @@ AsmReadIdtr (
   OUT     IA32_DESCRIPTOR           *Idtr
   );
 
+
 /**
   Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
 
@@ -4975,6 +6399,7 @@ AsmWriteIdtr (
   IN      CONST IA32_DESCRIPTOR     *Idtr
   );
 
+
 /**
   Reads the current Local Descriptor Table Register(LDTR) selector.
 
@@ -4990,6 +6415,7 @@ AsmReadLdtr (
   VOID
   );
 
+
 /**
   Writes the current Local Descriptor Table Register (GDTR) selector.
 
@@ -5005,6 +6431,7 @@ AsmWriteLdtr (
   IN      UINT16                    Ldtr
   );
 
+
 /**
   Save the current floating point/SSE/SSE2 context to a buffer.
 
@@ -5024,6 +6451,7 @@ AsmFxSave (
   OUT     IA32_FX_BUFFER            *Buffer
   );
 
+
 /**
   Restores the current floating point/SSE/SSE2 context from a buffer.
 
@@ -5044,6 +6472,7 @@ AsmFxRestore (
   IN      CONST IA32_FX_BUFFER      *Buffer
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #0 (MM0).
 
@@ -5059,6 +6488,7 @@ AsmReadMm0 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #1 (MM1).
 
@@ -5074,6 +6504,7 @@ AsmReadMm1 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #2 (MM2).
 
@@ -5089,6 +6520,7 @@ AsmReadMm2 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #3 (MM3).
 
@@ -5104,6 +6536,7 @@ AsmReadMm3 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #4 (MM4).
 
@@ -5119,6 +6552,7 @@ AsmReadMm4 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #5 (MM5).
 
@@ -5134,6 +6568,7 @@ AsmReadMm5 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #6 (MM6).
 
@@ -5149,6 +6584,7 @@ AsmReadMm6 (
   VOID
   );
 
+
 /**
   Reads the current value of 64-bit MMX Register #7 (MM7).
 
@@ -5164,6 +6600,7 @@ AsmReadMm7 (
   VOID
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #0 (MM0).
 
@@ -5179,6 +6616,7 @@ AsmWriteMm0 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #1 (MM1).
 
@@ -5194,6 +6632,7 @@ AsmWriteMm1 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #2 (MM2).
 
@@ -5209,6 +6648,7 @@ AsmWriteMm2 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #3 (MM3).
 
@@ -5224,6 +6664,7 @@ AsmWriteMm3 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #4 (MM4).
 
@@ -5239,6 +6680,7 @@ AsmWriteMm4 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #5 (MM5).
 
@@ -5254,6 +6696,7 @@ AsmWriteMm5 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #6 (MM6).
 
@@ -5269,6 +6712,7 @@ AsmWriteMm6 (
   IN      UINT64                    Value
   );
 
+
 /**
   Writes the current value of 64-bit MMX Register #7 (MM7).
 
@@ -5284,6 +6728,7 @@ AsmWriteMm7 (
   IN      UINT64                    Value
   );
 
+
 /**
   Reads the current value of Time Stamp Counter (TSC).
 
@@ -5299,6 +6744,7 @@ AsmReadTsc (
   VOID
   );
 
+
 /**
   Reads the current value of a Performance Counter (PMC).
 
@@ -5316,6 +6762,7 @@ AsmReadPmc (
   IN      UINT32                    Index
   );
 
+
 /**
   Sets up a monitor buffer that is used by AsmMwait().
 
@@ -5340,6 +6787,7 @@ AsmMonitor (
   IN      UINTN                     Edx
   );
 
+
 /**
   Executes an MWAIT instruction.
 
@@ -5361,6 +6809,7 @@ AsmMwait (
   IN      UINTN                     Ecx
   );
 
+
 /**
   Executes a WBINVD instruction.
 
@@ -5374,6 +6823,7 @@ AsmWbinvd (
   VOID
   );
 
+
 /**
   Executes a INVD instruction.
 
@@ -5387,6 +6837,7 @@ AsmInvd (
   VOID
   );
 
+
 /**
   Flushes a cache line from all the instruction and data caches within the
   coherency domain of the CPU.
@@ -5408,6 +6859,7 @@ AsmFlushCacheLine (
   IN      VOID                      *LinearAddress
   );
 
+
 /**
   Enables the 32-bit paging mode on the CPU.
 
@@ -5454,6 +6906,7 @@ AsmEnablePaging32 (
   IN      VOID                      *NewStack
   );
 
+
 /**
   Disables the 32-bit paging mode on the CPU.
 
@@ -5497,6 +6950,7 @@ AsmDisablePaging32 (
   IN      VOID                      *NewStack
   );
 
+
 /**
   Enables the 64-bit paging mode on the CPU.
 
@@ -5539,6 +6993,7 @@ AsmEnablePaging64 (
   IN      UINT64                    NewStack
   );
 
+
 /**
   Disables the 64-bit paging mode on the CPU.
 
@@ -5579,6 +7034,7 @@ AsmDisablePaging64 (
   IN      UINT32                    NewStack
   );
 
+
 //
 // 16-bit thunking services
 //
@@ -5611,6 +7067,7 @@ AsmGetThunk16Properties (
   OUT     UINT32                    *ExtraStackSize
   );
 
+
 /**
   Prepares all structures a code required to use AsmThunk16().
 
@@ -5628,6 +7085,7 @@ AsmPrepareThunk16 (
   OUT     THUNK_CONTEXT             *ThunkContext
   );
 
+
 /**
   Transfers control to a 16-bit real mode entry point and returns the results.
 
@@ -5648,6 +7106,7 @@ AsmThunk16 (
   IN OUT  THUNK_CONTEXT             *ThunkContext
   );
 
+
 /**
   Prepares all structures and code for a 16-bit real mode thunk, transfers
   control to a 16-bit real mode entry point, and returns the results.
@@ -5671,89 +7130,9 @@ AsmPrepareAndThunk16 (
   IN OUT  THUNK_CONTEXT             *ThunkContext
   );
 
-typedef struct {
-  UINT64                            Status;
-  UINT64                            r9;
-  UINT64                            r10;
-  UINT64                            r11;
-} PAL_PROC_RETURN;
-
-//
-// IPF Specific functions
-//
-
-
-/**
-  Performs a PAL call using static calling convention.
-
-  An internal function to perform a PAL call using static calling convention.
-
-  @param  PalEntryPoint The entry point address of PAL. The address in ar.kr5
-                        would be used if this parameter were NULL on input.
-  @param  Arg1          The first argument of a PAL call.
-  @param  Arg1          The second argument of a PAL call.
-  @param  Arg1          The third argument of a PAL call.
-  @param  Arg1          The fourth argument of a PAL call.
-
-  @return The values returned in r8, r9, r10 and r11.
-
-**/
-PAL_PROC_RETURN
-PalCallStatic (
-  IN      CONST VOID                *PalEntryPoint,
-  IN      UINT64                    Arg1,
-  IN      UINT64                    Arg2,
-  IN      UINT64                    Arg3,
-  IN      UINT64                    Arg4
-  );
-
-
-/**
-  Returns the current value of ar.itc.
-
-  An internal function to return the current value of ar.itc, which is the
-  timer tick on IPF.
-
-  @return The currect value of ar.itc
-
-**/
-INT64
-IpfReadItc (
-  VOID
-  );
-
-
-/**
-  Flush a range of  cache lines in the cache coherency domain of the calling
-  CPU.
-
-  Invalidates the  cache lines specified by Address and Length. If Address is
-  not aligned on a cache line boundary, then entire cache line containing
-  Address is invalidated. If Address + Length is not aligned on a cache line
-  boundary, then the entire instruction cache line containing Address + Length
-  -1 is invalidated. This function may choose to invalidate the entire
-  instruction cache if that is more efficient than invalidating the specified
-  range. If Length is 0, the no instruction cache lines are invalidated.
-  Address is returned.
-
-  If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
-  @param  Address The base address of the instruction lines to invalidate. If
-                  the CPU is in a physical addressing mode, then Address is a
-                  physical address. If the CPU is in a virtual addressing mode,
-                  then Address is a virtual address.
-
-  @param  Length  The number of bytes to invalidate from the instruction cache.
-
-  @return Address
+#else
 
-**/
-VOID *
-EFIAPI
-IpfFlushCacheRange (
-  IN      VOID                      *Address,
-  IN      UINTN                     Length
-  );
+#endif
 
 #endif