8#ifndef _MTRR_SUPPORT_H_
9#define _MTRR_SUPPORT_H_
32#define UNIT_TEST_APP_NAME "MtrrLib Unit Tests"
33#define UNIT_TEST_APP_VERSION "1.0"
35#define SCRATCH_BUFFER_SIZE SIZE_16KB
38 UINT8 PhysicalAddressBits;
39 BOOLEAN MtrrSupported;
40 BOOLEAN FixedMtrrSupported;
41 MTRR_MEMORY_CACHE_TYPE DefaultCacheType;
42 UINT32 VariableMtrrCount;
46extern UINT32 mFixedMtrrsIndex[];
47extern BOOLEAN mRandomInput;
92 IN UINT32 PhysicalAddressBits,
113 IN MTRR_MEMORY_CACHE_TYPE DefaultType,
114 IN UINT32 PhysicalAddressBits,
116 IN UINT32 RawMemoryRangeCount,
131 IN UINT32 PhysicalAddressBits,
132 IN MTRR_MEMORY_CACHE_TYPE CacheType,
150 IN MTRR_MEMORY_CACHE_TYPE DefaultType,
151 IN UINT32 PhysicalAddressBits,
152 IN UINT32 VariableMtrrCount,
156 OUT UINT32 *MtrrCount
UINT64 Random64(UINT64 Start, UINT64 Limit)
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)
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)
VOID GenerateRandomNumbers(CHAR8 *FilePath, UINTN Count)
UNIT_TEST_STATUS EFIAPI InitializeMtrrRegs(IN MTRR_LIB_SYSTEM_PARAMETER *SystemParameter)
UINT32 Random32(UINT32 Start, UINT32 Limit)
MTRR_MEMORY_CACHE_TYPE GenerateRandomCacheType(VOID)
UNIT_TEST_STATUS EFIAPI InitializeSystem(IN UNIT_TEST_CONTEXT Context)
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)
VOID GenerateRandomMtrrPair(IN UINT32 PhysicalAddressBits, IN MTRR_MEMORY_CACHE_TYPE CacheType, OUT MTRR_VARIABLE_SETTING *MtrrPair OPTIONAL, OUT MTRR_MEMORY_RANGE *MtrrMemoryRange OPTIONAL)