diff options
Diffstat (limited to 'MdePkg/Include')
-rw-r--r-- | MdePkg/Include/Library/BaseLib.h | 231 |
1 files changed, 231 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index fb3ca34131..9b2be9a3ad 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -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,6 +3624,7 @@ CpuDeadLoop ( VOID ); + // // IA32 and X64 Specific Functions // @@ -3755,6 +3892,7 @@ AsmCpuid ( OUT UINT32 *Edx OPTIONAL ); + /** Retrieves CPUID information using an extended leaf identifier. @@ -3798,6 +3936,7 @@ AsmCpuidEx ( OUT UINT32 *Edx OPTIONAL ); + /** Returns the lower 32-bits of a Machine Specific Register(MSR). @@ -3818,6 +3957,7 @@ AsmReadMsr32 ( IN UINT32 Index ); + /** Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR). @@ -3841,6 +3981,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 +4008,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 +4035,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 +4066,7 @@ AsmMsrAndThenOr32 ( IN UINT32 OrData ); + /** Reads a bit field of an MSR. @@ -3953,6 +4097,7 @@ AsmMsrBitFieldRead32 ( IN UINTN EndBit ); + /** Writes a bit field to an MSR. @@ -3987,6 +4132,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 +4168,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 +4204,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 +4244,7 @@ AsmMsrBitFieldAndThenOr32 ( IN UINT32 OrData ); + /** Returns a 64-bit Machine Specific Register(MSR). @@ -4116,6 +4265,7 @@ AsmReadMsr64 ( IN UINT32 Index ); + /** Writes a 64-bit value to a Machine Specific Register(MSR), and returns the value. @@ -4140,6 +4290,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 +4316,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 +4342,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 +4372,7 @@ AsmMsrAndThenOr64 ( IN UINT64 OrData ); + /** Reads a bit field of an MSR. @@ -4249,6 +4403,7 @@ AsmMsrBitFieldRead64 ( IN UINTN EndBit ); + /** Writes a bit field to an MSR. @@ -4282,6 +4437,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 +4473,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 +4509,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 +4548,7 @@ AsmMsrBitFieldAndThenOr64 ( IN UINT64 OrData ); + /** Reads the current value of the EFLAGS register. @@ -4406,6 +4565,7 @@ AsmReadEflags ( VOID ); + /** Reads the current value of the Control Register 0 (CR0). @@ -4422,6 +4582,7 @@ AsmReadCr0 ( VOID ); + /** Reads the current value of the Control Register 2 (CR2). @@ -4438,6 +4599,7 @@ AsmReadCr2 ( VOID ); + /** Reads the current value of the Control Register 3 (CR3). @@ -4454,6 +4616,7 @@ AsmReadCr3 ( VOID ); + /** Reads the current value of the Control Register 4 (CR4). @@ -4470,6 +4633,7 @@ AsmReadCr4 ( VOID ); + /** Writes a value to Control Register 0 (CR0). @@ -4487,6 +4651,7 @@ AsmWriteCr0 ( UINTN Cr0 ); + /** Writes a value to Control Register 2 (CR2). @@ -4504,6 +4669,7 @@ AsmWriteCr2 ( UINTN Cr2 ); + /** Writes a value to Control Register 3 (CR3). @@ -4521,6 +4687,7 @@ AsmWriteCr3 ( UINTN Cr3 ); + /** Writes a value to Control Register 4 (CR4). @@ -4538,6 +4705,7 @@ AsmWriteCr4 ( UINTN Cr4 ); + /** Reads the current value of Debug Register 0 (DR0). @@ -4554,6 +4722,7 @@ AsmReadDr0 ( VOID ); + /** Reads the current value of Debug Register 1 (DR1). @@ -4570,6 +4739,7 @@ AsmReadDr1 ( VOID ); + /** Reads the current value of Debug Register 2 (DR2). @@ -4586,6 +4756,7 @@ AsmReadDr2 ( VOID ); + /** Reads the current value of Debug Register 3 (DR3). @@ -4602,6 +4773,7 @@ AsmReadDr3 ( VOID ); + /** Reads the current value of Debug Register 4 (DR4). @@ -4618,6 +4790,7 @@ AsmReadDr4 ( VOID ); + /** Reads the current value of Debug Register 5 (DR5). @@ -4634,6 +4807,7 @@ AsmReadDr5 ( VOID ); + /** Reads the current value of Debug Register 6 (DR6). @@ -4650,6 +4824,7 @@ AsmReadDr6 ( VOID ); + /** Reads the current value of Debug Register 7 (DR7). @@ -4666,6 +4841,7 @@ AsmReadDr7 ( VOID ); + /** Writes a value to Debug Register 0 (DR0). @@ -4683,6 +4859,7 @@ AsmWriteDr0 ( UINTN Dr0 ); + /** Writes a value to Debug Register 1 (DR1). @@ -4700,6 +4877,7 @@ AsmWriteDr1 ( UINTN Dr1 ); + /** Writes a value to Debug Register 2 (DR2). @@ -4717,6 +4895,7 @@ AsmWriteDr2 ( UINTN Dr2 ); + /** Writes a value to Debug Register 3 (DR3). @@ -4734,6 +4913,7 @@ AsmWriteDr3 ( UINTN Dr3 ); + /** Writes a value to Debug Register 4 (DR4). @@ -4751,6 +4931,7 @@ AsmWriteDr4 ( UINTN Dr4 ); + /** Writes a value to Debug Register 5 (DR5). @@ -4768,6 +4949,7 @@ AsmWriteDr5 ( UINTN Dr5 ); + /** Writes a value to Debug Register 6 (DR6). @@ -4785,6 +4967,7 @@ AsmWriteDr6 ( UINTN Dr6 ); + /** Writes a value to Debug Register 7 (DR7). @@ -4802,6 +4985,7 @@ AsmWriteDr7 ( UINTN Dr7 ); + /** Reads the current value of Code Segment Register (CS). @@ -4817,6 +5001,7 @@ AsmReadCs ( VOID ); + /** Reads the current value of Data Segment Register (DS). @@ -4832,6 +5017,7 @@ AsmReadDs ( VOID ); + /** Reads the current value of Extra Segment Register (ES). @@ -4847,6 +5033,7 @@ AsmReadEs ( VOID ); + /** Reads the current value of FS Data Segment Register (FS). @@ -4862,6 +5049,7 @@ AsmReadFs ( VOID ); + /** Reads the current value of GS Data Segment Register (GS). @@ -4877,6 +5065,7 @@ AsmReadGs ( VOID ); + /** Reads the current value of Stack Segment Register (SS). @@ -4892,6 +5081,7 @@ AsmReadSs ( VOID ); + /** Reads the current value of Task Register (TR). @@ -4907,6 +5097,7 @@ AsmReadTr ( VOID ); + /** Reads the current Global Descriptor Table Register(GDTR) descriptor. @@ -4924,6 +5115,7 @@ AsmReadGdtr ( OUT IA32_DESCRIPTOR *Gdtr ); + /** Writes the current Global Descriptor Table Register (GDTR) descriptor. @@ -4941,6 +5133,7 @@ AsmWriteGdtr ( IN CONST IA32_DESCRIPTOR *Gdtr ); + /** Reads the current Interrupt Descriptor Table Register(GDTR) descriptor. @@ -4958,6 +5151,7 @@ AsmReadIdtr ( OUT IA32_DESCRIPTOR *Idtr ); + /** Writes the current Interrupt Descriptor Table Register(GDTR) descriptor. @@ -4975,6 +5169,7 @@ AsmWriteIdtr ( IN CONST IA32_DESCRIPTOR *Idtr ); + /** Reads the current Local Descriptor Table Register(LDTR) selector. @@ -4990,6 +5185,7 @@ AsmReadLdtr ( VOID ); + /** Writes the current Local Descriptor Table Register (GDTR) selector. @@ -5005,6 +5201,7 @@ AsmWriteLdtr ( IN UINT16 Ldtr ); + /** Save the current floating point/SSE/SSE2 context to a buffer. @@ -5024,6 +5221,7 @@ AsmFxSave ( OUT IA32_FX_BUFFER *Buffer ); + /** Restores the current floating point/SSE/SSE2 context from a buffer. @@ -5044,6 +5242,7 @@ AsmFxRestore ( IN CONST IA32_FX_BUFFER *Buffer ); + /** Reads the current value of 64-bit MMX Register #0 (MM0). @@ -5059,6 +5258,7 @@ AsmReadMm0 ( VOID ); + /** Reads the current value of 64-bit MMX Register #1 (MM1). @@ -5074,6 +5274,7 @@ AsmReadMm1 ( VOID ); + /** Reads the current value of 64-bit MMX Register #2 (MM2). @@ -5089,6 +5290,7 @@ AsmReadMm2 ( VOID ); + /** Reads the current value of 64-bit MMX Register #3 (MM3). @@ -5104,6 +5306,7 @@ AsmReadMm3 ( VOID ); + /** Reads the current value of 64-bit MMX Register #4 (MM4). @@ -5119,6 +5322,7 @@ AsmReadMm4 ( VOID ); + /** Reads the current value of 64-bit MMX Register #5 (MM5). @@ -5134,6 +5338,7 @@ AsmReadMm5 ( VOID ); + /** Reads the current value of 64-bit MMX Register #6 (MM6). @@ -5149,6 +5354,7 @@ AsmReadMm6 ( VOID ); + /** Reads the current value of 64-bit MMX Register #7 (MM7). @@ -5164,6 +5370,7 @@ AsmReadMm7 ( VOID ); + /** Writes the current value of 64-bit MMX Register #0 (MM0). @@ -5179,6 +5386,7 @@ AsmWriteMm0 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #1 (MM1). @@ -5194,6 +5402,7 @@ AsmWriteMm1 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #2 (MM2). @@ -5209,6 +5418,7 @@ AsmWriteMm2 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #3 (MM3). @@ -5224,6 +5434,7 @@ AsmWriteMm3 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #4 (MM4). @@ -5239,6 +5450,7 @@ AsmWriteMm4 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #5 (MM5). @@ -5254,6 +5466,7 @@ AsmWriteMm5 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #6 (MM6). @@ -5269,6 +5482,7 @@ AsmWriteMm6 ( IN UINT64 Value ); + /** Writes the current value of 64-bit MMX Register #7 (MM7). @@ -5284,6 +5498,7 @@ AsmWriteMm7 ( IN UINT64 Value ); + /** Reads the current value of Time Stamp Counter (TSC). @@ -5299,6 +5514,7 @@ AsmReadTsc ( VOID ); + /** Reads the current value of a Performance Counter (PMC). @@ -5316,6 +5532,7 @@ AsmReadPmc ( IN UINT32 Index ); + /** Sets up a monitor buffer that is used by AsmMwait(). @@ -5340,6 +5557,7 @@ AsmMonitor ( IN UINTN Edx ); + /** Executes an MWAIT instruction. @@ -5361,6 +5579,7 @@ AsmMwait ( IN UINTN Ecx ); + /** Executes a WBINVD instruction. @@ -5374,6 +5593,7 @@ AsmWbinvd ( VOID ); + /** Executes a INVD instruction. @@ -5387,6 +5607,7 @@ AsmInvd ( VOID ); + /** Flushes a cache line from all the instruction and data caches within the coherency domain of the CPU. @@ -5408,6 +5629,7 @@ AsmFlushCacheLine ( IN VOID *LinearAddress ); + /** Enables the 32-bit paging mode on the CPU. @@ -5454,6 +5676,7 @@ AsmEnablePaging32 ( IN VOID *NewStack ); + /** Disables the 32-bit paging mode on the CPU. @@ -5497,6 +5720,7 @@ AsmDisablePaging32 ( IN VOID *NewStack ); + /** Enables the 64-bit paging mode on the CPU. @@ -5539,6 +5763,7 @@ AsmEnablePaging64 ( IN UINT64 NewStack ); + /** Disables the 64-bit paging mode on the CPU. @@ -5579,6 +5804,7 @@ AsmDisablePaging64 ( IN UINT32 NewStack ); + // // 16-bit thunking services // @@ -5611,6 +5837,7 @@ AsmGetThunk16Properties ( OUT UINT32 *ExtraStackSize ); + /** Prepares all structures a code required to use AsmThunk16(). @@ -5628,6 +5855,7 @@ AsmPrepareThunk16 ( OUT THUNK_CONTEXT *ThunkContext ); + /** Transfers control to a 16-bit real mode entry point and returns the results. @@ -5648,6 +5876,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,6 +5900,7 @@ AsmPrepareAndThunk16 ( IN OUT THUNK_CONTEXT *ThunkContext ); + typedef struct { UINT64 Status; UINT64 r9; @@ -5755,5 +5985,6 @@ IpfFlushCacheRange ( IN UINTN Length ); + #endif |