|
UINTN | Rand (VOID) |
|
VOID | GenerateRandomNumbers (CHAR8 *FilePath, UINTN Count) |
|
UINT32 EFIAPI | UnitTestMtrrLibAsmCpuidEx (IN UINT32 Index, IN UINT32 SubIndex, OUT UINT32 *Eax OPTIONAL, OUT UINT32 *Ebx OPTIONAL, OUT UINT32 *Ecx OPTIONAL, OUT UINT32 *Edx OPTIONAL) |
|
UINT32 EFIAPI | UnitTestMtrrLibAsmCpuid (IN UINT32 Index, OUT UINT32 *Eax OPTIONAL, OUT UINT32 *Ebx OPTIONAL, OUT UINT32 *Ecx OPTIONAL, OUT UINT32 *Edx OPTIONAL) |
|
UINT64 EFIAPI | UnitTestMtrrLibAsmReadMsr64 (IN UINT32 MsrIndex) |
|
UINT64 EFIAPI | UnitTestMtrrLibAsmWriteMsr64 (IN UINT32 MsrIndex, IN UINT64 Value) |
|
UNIT_TEST_STATUS EFIAPI | InitializeMtrrRegs (IN MTRR_LIB_SYSTEM_PARAMETER *SystemParameter) |
|
UNIT_TEST_STATUS EFIAPI | InitializeSystem (IN UNIT_TEST_CONTEXT Context) |
|
VOID | CollectTestResult (IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN UINT32 PhysicalAddressBits, IN UINT32 VariableMtrrCount, IN MTRR_SETTINGS *Mtrrs, OUT MTRR_MEMORY_RANGE *Ranges, IN OUT UINTN *RangeCount, OUT UINT32 *MtrrCount) |
|
UINT32 | Random32 (UINT32 Start, UINT32 Limit) |
|
UINT64 | Random64 (UINT64 Start, UINT64 Limit) |
|
VOID | GenerateRandomMtrrPair (IN UINT32 PhysicalAddressBits, IN MTRR_MEMORY_CACHE_TYPE CacheType, OUT MTRR_VARIABLE_SETTING *MtrrPair OPTIONAL, OUT MTRR_MEMORY_RANGE *MtrrMemoryRange OPTIONAL) |
|
BOOLEAN | RangesOverlap (IN MTRR_MEMORY_RANGE *Range, IN MTRR_MEMORY_RANGE *Ranges, IN UINTN Count) |
|
VOID | GenerateValidAndConfigurableMtrrPairs (IN UINT32 PhysicalAddressBits, IN OUT MTRR_MEMORY_RANGE *RawMemoryRanges, IN UINT32 UcCount, IN UINT32 WtCount, IN UINT32 WbCount, IN UINT32 WpCount, IN UINT32 WcCount) |
|
MTRR_MEMORY_CACHE_TYPE | GenerateRandomCacheType (VOID) |
|
INT32 | CompareFuncUint64 (CONST VOID *Left, CONST VOID *Right) |
|
VOID | DetermineMemoryCacheType (IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN OUT MTRR_MEMORY_RANGE *Range, IN MTRR_MEMORY_RANGE *Ranges, IN UINT32 RangeCount) |
|
UINT32 | GetNextDifferentElementInSortedArray (IN UINT32 Index, IN UINT64 *Array, IN UINT32 Count) |
|
VOID | RemoveDuplicatesInSortedArray (IN OUT UINT64 *Array, IN OUT UINT32 *Count) |
|
BOOLEAN | AddressInRange (IN UINT64 Address, IN MTRR_MEMORY_RANGE Range) |
|
UINT64 | GetOverlapBitFlag (IN MTRR_MEMORY_RANGE *RawMemoryRanges, IN UINT32 RawMemoryRangeCount, IN UINT64 Address) |
|
UINT32 | CheckOverlapBitFlagsRelation (IN UINT64 Flag1, IN UINT64 Flag2) |
|
BOOLEAN | IsEndpointInRanges (IN UINT64 Endpoint, IN MTRR_MEMORY_RANGE *Ranges, IN UINTN RangeCount) |
|
VOID | CompactAndExtendEffectiveMtrrMemoryRanges (IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN UINT32 PhysicalAddressBits, IN OUT MTRR_MEMORY_RANGE **EffectiveMtrrMemoryRanges, IN OUT UINTN *EffectiveMtrrMemoryRangesCount) |
|
VOID | CollectEndpoints (IN OUT UINT64 *Endpoints, IN OUT UINT32 *EndPointCount, IN MTRR_MEMORY_RANGE *RawMemoryRanges, IN UINT32 RawMemoryRangeCount) |
|
VOID | GetEffectiveMemoryRanges (IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN UINT32 PhysicalAddressBits, IN MTRR_MEMORY_RANGE *RawMemoryRanges, IN UINT32 RawMemoryRangeCount, OUT MTRR_MEMORY_RANGE *MemoryRanges, OUT UINTN *MemoryRangeCount) |
|
Unit tests of the MtrrLib instance of the MtrrLib class
Copyright (c) 2018 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Support.c.
UINT32 EFIAPI UnitTestMtrrLibAsmCpuid |
( |
IN UINT32 |
Index, |
|
|
OUT UINT32 *Eax |
OPTIONAL, |
|
|
OUT UINT32 *Ebx |
OPTIONAL, |
|
|
OUT UINT32 *Ecx |
OPTIONAL, |
|
|
OUT UINT32 *Edx |
OPTIONAL |
|
) |
| |
Retrieves CPUID information.
Executes the CPUID instruction with EAX set to the value specified by Index. This function always returns Index. If Eax is not NULL, then the value of EAX after CPUID is returned in Eax. If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx. If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx. If Edx is not NULL, then the value of EDX after CPUID is returned in Edx. This function is only available on IA-32 and x64.
- Parameters
-
Index | The 32-bit value to load into EAX prior to invoking the CPUID instruction. |
Eax | The pointer to the 32-bit EAX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Ebx | The pointer to the 32-bit EBX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Ecx | The pointer to the 32-bit ECX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Edx | The pointer to the 32-bit EDX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
- Returns
- Index.
Definition at line 205 of file Support.c.
UINT32 EFIAPI UnitTestMtrrLibAsmCpuidEx |
( |
IN UINT32 |
Index, |
|
|
IN UINT32 |
SubIndex, |
|
|
OUT UINT32 *Eax |
OPTIONAL, |
|
|
OUT UINT32 *Ebx |
OPTIONAL, |
|
|
OUT UINT32 *Ecx |
OPTIONAL, |
|
|
OUT UINT32 *Edx |
OPTIONAL |
|
) |
| |
Retrieves CPUID information using an extended leaf identifier.
Executes the CPUID instruction with EAX set to the value specified by Index and ECX set to the value specified by SubIndex. This function always returns Index. This function is only available on IA-32 and x64.
If Eax is not NULL, then the value of EAX after CPUID is returned in Eax. If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx. If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx. If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
- Parameters
-
Index | The 32-bit value to load into EAX prior to invoking the CPUID instruction. |
SubIndex | The 32-bit value to load into ECX prior to invoking the CPUID instruction. |
Eax | The pointer to the 32-bit EAX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Ebx | The pointer to the 32-bit EBX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Ecx | The pointer to the 32-bit ECX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
Edx | The pointer to the 32-bit EDX value returned by the CPUID instruction. This is an optional parameter that may be NULL. |
- Returns
- Index.
Definition at line 124 of file Support.c.
UINT64 EFIAPI UnitTestMtrrLibAsmReadMsr64 |
( |
IN UINT32 |
MsrIndex | ) |
|
Returns a 64-bit Machine Specific Register(MSR).
Reads and returns the 64-bit MSR specified by Index. No parameter checking is performed on Index, and some Index values may cause CPU exceptions. The caller must either guarantee that Index is valid, or the caller must set up exception handlers to catch the exceptions. This function is only available on IA-32 and x64.
- Parameters
-
MsrIndex | The 32-bit MSR index to read. |
- Returns
- The value of the MSR identified by MsrIndex.
Definition at line 232 of file Support.c.
UINT64 EFIAPI UnitTestMtrrLibAsmWriteMsr64 |
( |
IN UINT32 |
MsrIndex, |
|
|
IN UINT64 |
Value |
|
) |
| |
Writes a 64-bit value to a Machine Specific Register(MSR), and returns the value.
Writes the 64-bit value specified by Value to the MSR specified by Index. The 64-bit value written to the MSR is returned. No parameter checking is performed on Index or Value, and some of these may cause CPU exceptions. The caller must either guarantee that Index and Value are valid, or the caller must establish proper exception handlers. This function is only available on IA-32 and x64.
- Parameters
-
MsrIndex | The 32-bit MSR index to write. |
Value | The 64-bit value to write to the MSR. |
- Returns
- Value
Definition at line 298 of file Support.c.