UefiCpuPkg/MtrrLib.h: use cache type #defines from ArchitecturalMsr.h

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2024-01-25 08:38:00 +01:00 committed by mergify[bot]
parent 5bef25dca4
commit 71e6cc8dad

View File

@ -9,6 +9,8 @@
#ifndef _MTRR_LIB_H_ #ifndef _MTRR_LIB_H_
#define _MTRR_LIB_H_ #define _MTRR_LIB_H_
#include <Register/Intel/ArchitecturalMsr.h>
// //
// According to IA32 SDM, MTRRs number and MSR offset are always consistent // According to IA32 SDM, MTRRs number and MSR offset are always consistent
// for IA32 processor family // for IA32 processor family
@ -82,20 +84,20 @@ typedef struct _MTRR_SETTINGS_ {
// Memory cache types // Memory cache types
// //
typedef enum { typedef enum {
CacheUncacheable = 0, CacheUncacheable = MSR_IA32_MTRR_CACHE_UNCACHEABLE,
CacheWriteCombining = 1, CacheWriteCombining = MSR_IA32_MTRR_CACHE_WRITE_COMBINING,
CacheWriteThrough = 4, CacheWriteThrough = MSR_IA32_MTRR_CACHE_WRITE_THROUGH,
CacheWriteProtected = 5, CacheWriteProtected = MSR_IA32_MTRR_CACHE_WRITE_PROTECTED,
CacheWriteBack = 6, CacheWriteBack = MSR_IA32_MTRR_CACHE_WRITE_BACK,
CacheInvalid = 7 CacheInvalid = MSR_IA32_MTRR_CACHE_INVALID_TYPE,
} MTRR_MEMORY_CACHE_TYPE; } MTRR_MEMORY_CACHE_TYPE;
#define MTRR_CACHE_UNCACHEABLE 0 #define MTRR_CACHE_UNCACHEABLE MSR_IA32_MTRR_CACHE_UNCACHEABLE
#define MTRR_CACHE_WRITE_COMBINING 1 #define MTRR_CACHE_WRITE_COMBINING MSR_IA32_MTRR_CACHE_WRITE_COMBINING
#define MTRR_CACHE_WRITE_THROUGH 4 #define MTRR_CACHE_WRITE_THROUGH MSR_IA32_MTRR_CACHE_WRITE_THROUGH
#define MTRR_CACHE_WRITE_PROTECTED 5 #define MTRR_CACHE_WRITE_PROTECTED MSR_IA32_MTRR_CACHE_WRITE_PROTECTED
#define MTRR_CACHE_WRITE_BACK 6 #define MTRR_CACHE_WRITE_BACK MSR_IA32_MTRR_CACHE_WRITE_BACK
#define MTRR_CACHE_INVALID_TYPE 7 #define MTRR_CACHE_INVALID_TYPE MSR_IA32_MTRR_CACHE_INVALID_TYPE
typedef struct { typedef struct {
UINT64 BaseAddress; UINT64 BaseAddress;