TianoCore EDK2 master
Loading...
Searching...
No Matches
MonitorMwait.c
Go to the documentation of this file.
1
9#include "CpuCommonFeatures.h"
10
27BOOLEAN
28EFIAPI
30 IN UINTN ProcessorNumber,
32 IN VOID *ConfigData OPTIONAL
33 )
34{
35 return (CpuInfo->CpuIdVersionInfoEcx.Bits.MONITOR == 1);
36}
37
55RETURN_STATUS
56EFIAPI
58 IN UINTN ProcessorNumber,
60 IN VOID *ConfigData OPTIONAL,
61 IN BOOLEAN State
62 )
63{
64 //
65 // The scope of the MSR_IA32_MISC_ENABLE is core for below processor type, only program
66 // MSR_IA32_MISC_ENABLE for thread 0 in each core.
67 //
68 if (IS_CORE2_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
69 IS_ATOM_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
70 IS_GOLDMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
71 IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
72 IS_PENTIUM_4_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
73 IS_CORE_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel))
74 {
75 if (CpuInfo->ProcessorInfo.Location.Thread != 0) {
76 return RETURN_SUCCESS;
77 }
78 }
79
81 ProcessorNumber,
82 Msr,
85 Bits.MONITOR,
86 (State) ? 1 : 0
87 );
88 return RETURN_SUCCESS;
89}
UINT64 UINTN
#define IS_ATOM_PROCESSOR(DisplayFamily, DisplayModel)
Definition: AtomMsr.h:32
#define IS_CORE2_PROCESSOR(DisplayFamily, DisplayModel)
Definition: Core2Msr.h:32
#define IS_CORE_PROCESSOR(DisplayFamily, DisplayModel)
Definition: CoreMsr.h:32
#define IS_GOLDMONT_PROCESSOR(DisplayFamily, DisplayModel)
Definition: GoldmontMsr.h:32
#define RETURN_SUCCESS
Definition: Base.h:1066
#define IN
Definition: Base.h:279
#define MSR_IA32_MISC_ENABLE
RETURN_STATUS EFIAPI MonitorMwaitInitialize(IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL, IN BOOLEAN State)
Definition: MonitorMwait.c:57
BOOLEAN EFIAPI MonitorMwaitSupport(IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL)
Definition: MonitorMwait.c:29
#define IS_PENTIUM_4_PROCESSOR(DisplayFamily, DisplayModel)
Definition: Pentium4Msr.h:32
#define CPU_REGISTER_TABLE_WRITE_FIELD(ProcessorNumber, RegisterType, Index, Type, Field, Value)
#define IS_SILVERMONT_PROCESSOR(DisplayFamily, DisplayModel)
Definition: SilvermontMsr.h:32