3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
30 UINT32 UpdateRevision
;
34 UINT32 LoaderRevision
;
35 UINT32 ProcessorFlags
;
39 } EFI_CPU_MICROCODE_HEADER
;
42 UINT32 ExtendedSignatureCount
;
43 UINT32 ExtendedTableChecksum
;
45 } EFI_CPU_MICROCODE_EXTENDED_TABLE_HEADER
;
48 UINT32 ProcessorSignature
;
50 UINT32 ProcessorChecksum
;
51 } EFI_CPU_MICROCODE_EXTENDED_TABLE
;
59 UINT32 ExtendedModel
: 4;
60 UINT32 ExtendedFamily
: 8;
64 #define EFI_CPUID_SIGNATURE 0x0
65 #define EFI_CPUID_VERSION_INFO 0x1
66 #define EFI_CPUID_CACHE_INFO 0x2
67 #define EFI_CPUID_SERIAL_NUMBER 0x3
68 #define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
69 #define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
70 #define EFI_CPUID_BRAND_STRING1 0x80000002
71 #define EFI_CPUID_BRAND_STRING2 0x80000003
72 #define EFI_CPUID_BRAND_STRING3 0x80000004
74 #define EFI_MSR_IA32_PLATFORM_ID 0x17
75 #define EFI_MSR_IA32_APIC_BASE 0x1B
76 #define EFI_MSR_EBC_HARD_POWERON 0x2A
77 #define EFI_MSR_EBC_SOFT_POWERON 0x2B
78 #define BINIT_DRIVER_DISABLE 0x40
79 #define INTERNAL_MCERR_DISABLE 0x20
80 #define INITIATOR_MCERR_DISABLE 0x10
81 #define EFI_MSR_EBC_FREQUENCY_ID 0x2C
82 #define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
83 #define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
84 #define EFI_MSR_PSB_CLOCK_STATUS 0xCD
85 #define EFI_APIC_GLOBAL_ENABLE 0x800
86 #define EFI_MSR_IA32_MISC_ENABLE 0x1A0
87 #define LIMIT_CPUID_MAXVAL_ENABLE_BIT 0x00400000
88 #define AUTOMATIC_THERMAL_CONTROL_ENABLE_BIT 0x00000008
89 #define COMPATIBLE_FPU_OPCODE_ENABLE_BIT 0x00000004
90 #define LOGICAL_PROCESSOR_PRIORITY_ENABLE_BIT 0x00000002
91 #define FAST_STRING_ENABLE_BIT 0x00000001
93 #define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
94 #define EFI_CACHE_VARIABLE_MTRR_END 0x20F
95 #define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
96 #define EFI_CACHE_MTRR_VALID 0x800
97 #define EFI_CACHE_FIXED_MTRR_VALID 0x400
98 #define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
99 #define EFI_MSR_VALID_MASK 0xFFFFFFFFF
100 #define EFI_CACHE_VALID_EXTENDED_ADDRESS 0xFFFFFFFFFF000
101 #define EFI_MSR_VALID_EXTENDED_MASK 0xFFFFFFFFFFFFF
103 #define EFI_IA32_MTRR_FIX64K_00000 0x250
104 #define EFI_IA32_MTRR_FIX16K_80000 0x258
105 #define EFI_IA32_MTRR_FIX16K_A0000 0x259
106 #define EFI_IA32_MTRR_FIX4K_C0000 0x268
107 #define EFI_IA32_MTRR_FIX4K_C8000 0x269
108 #define EFI_IA32_MTRR_FIX4K_D0000 0x26A
109 #define EFI_IA32_MTRR_FIX4K_D8000 0x26B
110 #define EFI_IA32_MTRR_FIX4K_E0000 0x26C
111 #define EFI_IA32_MTRR_FIX4K_E8000 0x26D
112 #define EFI_IA32_MTRR_FIX4K_F0000 0x26E
113 #define EFI_IA32_MTRR_FIX4K_F8000 0x26F
115 #define EFI_IA32_MCG_CAP 0x179
116 #define EFI_IA32_MCG_CTL 0x17B
117 #define EFI_IA32_MC0_CTL 0x400
118 #define EFI_IA32_MC0_STATUS 0x401
120 #define EFI_IA32_PERF_STATUS 0x198
121 #define EFI_IA32_PERF_CTL 0x199
123 #define EFI_CACHE_UNCACHEABLE 0
124 #define EFI_CACHE_WRITECOMBINING 1
125 #define EFI_CACHE_WRITETHROUGH 4
126 #define EFI_CACHE_WRITEPROTECTED 5
127 #define EFI_CACHE_WRITEBACK 6
130 // Combine f(FamilyId), m(Model), s(SteppingId) to a single 32 bit number
132 #define EfiMakeCpuVersion(f, m, s) \
133 (((UINT32) (f) << 16) | ((UINT32) (m) << 8) | ((UINT32) (s)))
150 Write back and invalidate the Cpu cache
164 Invalidate the Cpu cache
178 Get the Cpu info by execute the CPUID instruction
180 @param[in] RegisterInEax The input value to put into register EAX
181 @param[in] Regs The Output value
189 IN UINT32 RegisterInEax
,
190 OUT EFI_CPUID_REGISTER
*Regs
194 When RegisterInEax != 4, the functionality is the same as EfiCpuid.
195 When RegisterInEax == 4, the function return the deterministic cache
196 parameters by excuting the CPUID instruction.
198 @param[in] RegisterInEax The input value to put into register EAX.
199 @param[in] CacheLevel The deterministic cache level.
200 @param[in] Regs The Output value.
208 IN UINT32 RegisterInEax
,
209 IN UINT32 CacheLevel
,
210 OUT EFI_CPUID_REGISTER
*Regs
216 @param[in] Index The index value to select the register
218 @retval Return the read data
230 @param[in] Index The index value to select the register
231 @param[in] Value The value to write to the selected register
248 @retval Return the read data
258 Writing back and invalidate the cache,then diable it
272 Invalidate the cache,then Enable it
290 @retval Return the Eflags value
309 EfiDisableInterrupts (
323 EfiEnableInterrupts (
328 Extract CPU detail version infomation
330 @param[in] FamilyId FamilyId, including ExtendedFamilyId
331 @param[in] Model Model, including ExtendedModel
332 @param[in] SteppingId SteppingId
333 @param[in] Processor Processor
339 IN UINT16
*FamilyId
, OPTIONAL
340 IN UINT8
*Model
, OPTIONAL
341 IN UINT8
*SteppingId
, OPTIONAL
342 IN UINT8
*Processor OPTIONAL