]>
Commit | Line | Data |
---|---|---|
80c4b236 JF |
1 | /** @file\r |
2 | CPU Common features library header file.\r | |
3 | \r | |
4 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _CPU_COMMON_FEATURES_H_\r | |
16 | #define _CPU_COMMON_FEATURES_H_\r | |
17 | \r | |
18 | #include <PiDxe.h>\r | |
19 | \r | |
20 | #include <Library/BaseLib.h>\r | |
21 | #include <Library/PcdLib.h>\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/RegisterCpuFeaturesLib.h>\r | |
24 | #include <Library/BaseMemoryLib.h>\r | |
25 | #include <Library/MemoryAllocationLib.h>\r | |
26 | #include <Library/LocalApicLib.h>\r | |
27 | \r | |
28 | #include <Register/Cpuid.h>\r | |
29 | #include <Register/Msr.h>\r | |
30 | \r | |
31 | /**\r | |
32 | Prepares for the data used by CPU feature detection and initialization.\r | |
33 | \r | |
34 | @param[in] NumberOfProcessors The number of CPUs in the platform.\r | |
35 | \r | |
36 | @return Pointer to a buffer of CPU related configuration data.\r | |
37 | \r | |
38 | @note This service could be called by BSP only.\r | |
39 | **/\r | |
40 | VOID *\r | |
41 | EFIAPI\r | |
42 | AesniGetConfigData (\r | |
43 | IN UINTN NumberOfProcessors\r | |
44 | );\r | |
45 | \r | |
46 | /**\r | |
47 | Detects if AESNI feature supported on current processor.\r | |
48 | \r | |
49 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
50 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
51 | structure for the CPU executing this function.\r | |
52 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
53 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
54 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
55 | RegisterCpuFeature().\r | |
56 | \r | |
57 | @retval TRUE AESNI feature is supported.\r | |
58 | @retval FALSE AESNI feature is not supported.\r | |
59 | \r | |
60 | @note This service could be called by BSP/APs.\r | |
61 | **/\r | |
62 | BOOLEAN\r | |
63 | EFIAPI\r | |
64 | AesniSupport (\r | |
65 | IN UINTN ProcessorNumber,\r | |
66 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
67 | IN VOID *ConfigData OPTIONAL\r | |
68 | );\r | |
69 | \r | |
70 | /**\r | |
71 | Initializes AESNI feature to specific state.\r | |
72 | \r | |
73 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
74 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
75 | structure for the CPU executing this function.\r | |
76 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
77 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
78 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
79 | RegisterCpuFeature().\r | |
80 | @param[in] State If TRUE, then the AESNI feature must be enabled.\r | |
81 | If FALSE, then the AESNI feature must be disabled.\r | |
82 | \r | |
83 | @retval RETURN_SUCCESS AESNI feature is initialized.\r | |
84 | \r | |
85 | @note This service could be called by BSP only.\r | |
86 | **/\r | |
87 | RETURN_STATUS\r | |
88 | EFIAPI\r | |
89 | AesniInitialize (\r | |
90 | IN UINTN ProcessorNumber,\r | |
91 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
92 | IN VOID *ConfigData, OPTIONAL\r | |
93 | IN BOOLEAN State\r | |
94 | );\r | |
95 | \r | |
96 | /**\r | |
97 | Detects if Clock Modulation feature supported on current processor.\r | |
98 | \r | |
99 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
100 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
101 | structure for the CPU executing this function.\r | |
102 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
103 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
104 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
105 | RegisterCpuFeature().\r | |
106 | \r | |
107 | @retval TRUE Clock Modulation feature is supported.\r | |
108 | @retval FALSE Clock Modulation feature is not supported.\r | |
109 | \r | |
110 | @note This service could be called by BSP/APs.\r | |
111 | **/\r | |
112 | BOOLEAN\r | |
113 | EFIAPI\r | |
114 | ClockModulationSupport (\r | |
115 | IN UINTN ProcessorNumber,\r | |
116 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
117 | IN VOID *ConfigData OPTIONAL\r | |
118 | );\r | |
119 | \r | |
120 | /**\r | |
121 | Initializes Clock Modulation feature to specific state.\r | |
122 | \r | |
123 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
124 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
125 | structure for the CPU executing this function.\r | |
126 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
127 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
128 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
129 | RegisterCpuFeature().\r | |
130 | @param[in] State If TRUE, then the Clock Modulation feature must be enabled.\r | |
131 | If FALSE, then the Clock Modulation feature must be disabled.\r | |
132 | \r | |
133 | @retval RETURN_SUCCESS Clock Modulation feature is initialized.\r | |
134 | \r | |
135 | @note This service could be called by BSP only.\r | |
136 | **/\r | |
137 | RETURN_STATUS\r | |
138 | EFIAPI\r | |
139 | ClockModulationInitialize (\r | |
140 | IN UINTN ProcessorNumber,\r | |
141 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
142 | IN VOID *ConfigData, OPTIONAL\r | |
143 | IN BOOLEAN State\r | |
144 | );\r | |
145 | \r | |
146 | /**\r | |
147 | Detects if Enhanced Intel SpeedStep feature supported on current processor.\r | |
148 | \r | |
149 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
150 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
151 | structure for the CPU executing this function.\r | |
152 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
153 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
154 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
155 | RegisterCpuFeature().\r | |
156 | \r | |
157 | @retval TRUE Enhanced Intel SpeedStep feature is supported.\r | |
158 | @retval FALSE Enhanced Intel SpeedStep feature is not supported.\r | |
159 | \r | |
160 | @note This service could be called by BSP/APs.\r | |
161 | **/\r | |
162 | BOOLEAN\r | |
163 | EFIAPI\r | |
164 | EistSupport (\r | |
165 | IN UINTN ProcessorNumber,\r | |
166 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
167 | IN VOID *ConfigData OPTIONAL\r | |
168 | );\r | |
169 | \r | |
170 | /**\r | |
171 | Initializes Enhanced Intel SpeedStep feature to specific state.\r | |
172 | \r | |
173 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
174 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
175 | structure for the CPU executing this function.\r | |
176 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
177 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
178 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
179 | RegisterCpuFeature().\r | |
180 | @param[in] State If TRUE, then the Enhanced Intel SpeedStep feature\r | |
181 | must be enabled.\r | |
182 | If FALSE, then the Enhanced Intel SpeedStep feature\r | |
183 | must be disabled.\r | |
184 | \r | |
185 | @retval RETURN_SUCCESS Enhanced Intel SpeedStep feature is initialized.\r | |
186 | \r | |
187 | @note This service could be called by BSP only.\r | |
188 | **/\r | |
189 | RETURN_STATUS\r | |
190 | EFIAPI\r | |
191 | EistInitialize (\r | |
192 | IN UINTN ProcessorNumber,\r | |
193 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
194 | IN VOID *ConfigData, OPTIONAL\r | |
195 | IN BOOLEAN State\r | |
196 | );\r | |
197 | \r | |
198 | /**\r | |
199 | Detects if Execute Disable feature supported on current processor.\r | |
200 | \r | |
201 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
202 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
203 | structure for the CPU executing this function.\r | |
204 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
205 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
206 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
207 | RegisterCpuFeature().\r | |
208 | \r | |
209 | @retval TRUE Execute Disable feature is supported.\r | |
210 | @retval FALSE Execute Disable feature is not supported.\r | |
211 | \r | |
212 | @note This service could be called by BSP/APs.\r | |
213 | **/\r | |
214 | BOOLEAN\r | |
215 | EFIAPI\r | |
216 | ExecuteDisableSupport (\r | |
217 | IN UINTN ProcessorNumber,\r | |
218 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
219 | IN VOID *ConfigData OPTIONAL\r | |
220 | );\r | |
221 | \r | |
222 | /**\r | |
223 | Initializes Execute Disable feature to specific state.\r | |
224 | \r | |
225 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
226 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
227 | structure for the CPU executing this function.\r | |
228 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
229 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
230 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
231 | RegisterCpuFeature().\r | |
232 | @param[in] State If TRUE, then the Execute Disable feature must be enabled.\r | |
233 | If FALSE, then the Execute Disable feature must be disabled.\r | |
234 | \r | |
235 | @retval RETURN_SUCCESS Execute Disable feature is initialized.\r | |
236 | \r | |
237 | @note This service could be called by BSP only.\r | |
238 | **/\r | |
239 | RETURN_STATUS\r | |
240 | EFIAPI\r | |
241 | ExecuteDisableInitialize (\r | |
242 | IN UINTN ProcessorNumber,\r | |
243 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
244 | IN VOID *ConfigData, OPTIONAL\r | |
245 | IN BOOLEAN State\r | |
246 | );\r | |
247 | \r | |
248 | /**\r | |
249 | Initializes Fast-Strings feature to specific state.\r | |
250 | \r | |
251 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
252 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
253 | structure for the CPU executing this function.\r | |
254 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
255 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
256 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
257 | RegisterCpuFeature().\r | |
258 | @param[in] State If TRUE, then the Fast-Strings feature must be enabled.\r | |
259 | If FALSE, then the Fast-Strings feature must be disabled.\r | |
260 | \r | |
261 | @retval RETURN_SUCCESS Fast-Strings feature is initialized.\r | |
262 | \r | |
263 | @note This service could be called by BSP only.\r | |
264 | **/\r | |
265 | RETURN_STATUS\r | |
266 | EFIAPI\r | |
267 | FastStringsInitialize (\r | |
268 | IN UINTN ProcessorNumber,\r | |
269 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
270 | IN VOID *ConfigData, OPTIONAL\r | |
271 | IN BOOLEAN State\r | |
272 | );\r | |
273 | \r | |
274 | /**\r | |
275 | Detects if MONITOR/MWAIT feature supported on current processor.\r | |
276 | \r | |
277 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
278 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
279 | structure for the CPU executing this function.\r | |
280 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
281 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
282 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
283 | RegisterCpuFeature().\r | |
284 | \r | |
285 | @retval TRUE MONITOR/MWAIT feature is supported.\r | |
286 | @retval FALSE MONITOR/MWAIT feature is not supported.\r | |
287 | \r | |
288 | @note This service could be called by BSP/APs.\r | |
289 | **/\r | |
290 | BOOLEAN\r | |
291 | EFIAPI\r | |
292 | MonitorMwaitSupport (\r | |
293 | IN UINTN ProcessorNumber,\r | |
294 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
295 | IN VOID *ConfigData OPTIONAL\r | |
296 | );\r | |
297 | \r | |
298 | /**\r | |
299 | Initializes MONITOR/MWAIT feature to specific state.\r | |
300 | \r | |
301 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
302 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
303 | structure for the CPU executing this function.\r | |
304 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
305 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
306 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
307 | RegisterCpuFeature().\r | |
308 | @param[in] State If TRUE, then the MONITOR/MWAIT feature must be enabled.\r | |
309 | If FALSE, then the MONITOR/MWAIT feature must be disabled.\r | |
310 | \r | |
311 | @retval RETURN_SUCCESS MONITOR/MWAIT feature is initialized.\r | |
312 | \r | |
313 | @note This service could be called by BSP only.\r | |
314 | **/\r | |
315 | RETURN_STATUS\r | |
316 | EFIAPI\r | |
317 | MonitorMwaitInitialize (\r | |
318 | IN UINTN ProcessorNumber,\r | |
319 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
320 | IN VOID *ConfigData, OPTIONAL\r | |
321 | IN BOOLEAN State\r | |
322 | );\r | |
323 | \r | |
324 | /**\r | |
325 | Detects if VMX feature supported on current processor.\r | |
326 | \r | |
327 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
328 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
329 | structure for the CPU executing this function.\r | |
330 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
331 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
332 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
333 | RegisterCpuFeature().\r | |
334 | \r | |
335 | @retval TRUE VMX feature is supported.\r | |
336 | @retval FALSE VMX feature is not supported.\r | |
337 | \r | |
338 | @note This service could be called by BSP/APs.\r | |
339 | **/\r | |
340 | BOOLEAN\r | |
341 | EFIAPI\r | |
342 | VmxSupport (\r | |
343 | IN UINTN ProcessorNumber,\r | |
344 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
345 | IN VOID *ConfigData OPTIONAL\r | |
346 | );\r | |
347 | \r | |
348 | /**\r | |
b1fe2029 | 349 | Initializes VMX feature to specific state.\r |
80c4b236 JF |
350 | \r |
351 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
352 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
353 | structure for the CPU executing this function.\r | |
354 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
355 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
356 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
357 | RegisterCpuFeature().\r | |
b1fe2029 ED |
358 | @param[in] State If TRUE, then the VMX feature must be enabled.\r |
359 | If FALSE, then the VMX feature must be disabled.\r | |
80c4b236 | 360 | \r |
b1fe2029 | 361 | @retval RETURN_SUCCESS VMX feature is initialized.\r |
80c4b236 JF |
362 | \r |
363 | @note This service could be called by BSP only.\r | |
364 | **/\r | |
365 | RETURN_STATUS\r | |
366 | EFIAPI\r | |
b1fe2029 | 367 | VmxInitialize (\r |
80c4b236 JF |
368 | IN UINTN ProcessorNumber,\r |
369 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
370 | IN VOID *ConfigData, OPTIONAL\r | |
371 | IN BOOLEAN State\r | |
372 | );\r | |
373 | \r | |
374 | /**\r | |
375 | Detects if Lock Feature Control Register feature supported on current processor.\r | |
376 | \r | |
377 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
378 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
379 | structure for the CPU executing this function.\r | |
380 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
381 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
382 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
383 | RegisterCpuFeature().\r | |
384 | \r | |
385 | @retval TRUE Lock Feature Control Register feature is supported.\r | |
386 | @retval FALSE Lock Feature Control Register feature is not supported.\r | |
387 | \r | |
388 | @note This service could be called by BSP/APs.\r | |
389 | **/\r | |
390 | BOOLEAN\r | |
391 | EFIAPI\r | |
392 | LockFeatureControlRegisterSupport (\r | |
393 | IN UINTN ProcessorNumber,\r | |
394 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
395 | IN VOID *ConfigData OPTIONAL\r | |
396 | );\r | |
397 | \r | |
398 | /**\r | |
399 | Initializes Lock Feature Control Register feature to specific state.\r | |
400 | \r | |
401 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
402 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
403 | structure for the CPU executing this function.\r | |
404 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
405 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
406 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
407 | RegisterCpuFeature().\r | |
408 | @param[in] State If TRUE, then the Lock Feature Control Register feature must be enabled.\r | |
409 | If FALSE, then the Lock Feature Control Register feature must be disabled.\r | |
410 | \r | |
411 | @retval RETURN_SUCCESS Lock Feature Control Register feature is initialized.\r | |
412 | \r | |
413 | @note This service could be called by BSP only.\r | |
414 | **/\r | |
415 | RETURN_STATUS\r | |
416 | EFIAPI\r | |
417 | LockFeatureControlRegisterInitialize (\r | |
418 | IN UINTN ProcessorNumber,\r | |
419 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
420 | IN VOID *ConfigData, OPTIONAL\r | |
421 | IN BOOLEAN State\r | |
422 | );\r | |
423 | \r | |
424 | /**\r | |
425 | Detects if SMX feature supported on current processor.\r | |
426 | \r | |
427 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
428 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
429 | structure for the CPU executing this function.\r | |
430 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
431 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
432 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
433 | RegisterCpuFeature().\r | |
434 | \r | |
435 | @retval TRUE SMX feature is supported.\r | |
436 | @retval FALSE SMX feature is not supported.\r | |
437 | \r | |
438 | @note This service could be called by BSP/APs.\r | |
439 | **/\r | |
440 | BOOLEAN\r | |
441 | EFIAPI\r | |
442 | SmxSupport (\r | |
443 | IN UINTN ProcessorNumber,\r | |
444 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
445 | IN VOID *ConfigData OPTIONAL\r | |
446 | );\r | |
447 | \r | |
448 | /**\r | |
b1fe2029 | 449 | Initializes SMX feature to specific state.\r |
80c4b236 JF |
450 | \r |
451 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
452 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
453 | structure for the CPU executing this function.\r | |
454 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
455 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
456 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
457 | RegisterCpuFeature().\r | |
b1fe2029 ED |
458 | @param[in] State If TRUE, then SMX feature must be enabled.\r |
459 | If FALSE, then SMX feature must be disabled.\r | |
80c4b236 | 460 | \r |
b1fe2029 ED |
461 | @retval RETURN_SUCCESS SMX feature is initialized.\r |
462 | @retval RETURN_UNSUPPORTED VMX not initialized.\r | |
80c4b236 JF |
463 | \r |
464 | @note This service could be called by BSP only.\r | |
465 | **/\r | |
466 | RETURN_STATUS\r | |
467 | EFIAPI\r | |
b1fe2029 | 468 | SmxInitialize (\r |
80c4b236 JF |
469 | IN UINTN ProcessorNumber,\r |
470 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
471 | IN VOID *ConfigData, OPTIONAL\r | |
472 | IN BOOLEAN State\r | |
473 | );\r | |
474 | \r | |
475 | /**\r | |
476 | Detects if LimitCpuidMaxval feature supported on current processor.\r | |
477 | \r | |
478 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
479 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
480 | structure for the CPU executing this function.\r | |
481 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
482 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
483 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
484 | RegisterCpuFeature().\r | |
485 | \r | |
486 | @retval TRUE LimitCpuidMaxval feature is supported.\r | |
487 | @retval FALSE LimitCpuidMaxval feature is not supported.\r | |
488 | \r | |
489 | @note This service could be called by BSP/APs.\r | |
490 | **/\r | |
491 | BOOLEAN\r | |
492 | EFIAPI\r | |
493 | LimitCpuidMaxvalSupport (\r | |
494 | IN UINTN ProcessorNumber,\r | |
495 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
496 | IN VOID *ConfigData OPTIONAL\r | |
497 | );\r | |
498 | \r | |
499 | /**\r | |
500 | Initializes LimitCpuidMaxval feature to specific state.\r | |
501 | \r | |
502 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
503 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
504 | structure for the CPU executing this function.\r | |
505 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
506 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
507 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
508 | RegisterCpuFeature().\r | |
509 | @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.\r | |
510 | If FALSE, then the LimitCpuidMaxval feature must be disabled.\r | |
511 | \r | |
512 | @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.\r | |
513 | \r | |
514 | @note This service could be called by BSP only.\r | |
515 | **/\r | |
516 | RETURN_STATUS\r | |
517 | EFIAPI\r | |
518 | LimitCpuidMaxvalInitialize (\r | |
519 | IN UINTN ProcessorNumber,\r | |
520 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
521 | IN VOID *ConfigData, OPTIONAL\r | |
522 | IN BOOLEAN State\r | |
523 | );\r | |
524 | \r | |
525 | /**\r | |
526 | Detects if Machine Check Exception feature supported on current processor.\r | |
527 | \r | |
528 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
529 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
530 | structure for the CPU executing this function.\r | |
531 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
532 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
533 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
534 | RegisterCpuFeature().\r | |
535 | \r | |
536 | @retval TRUE Machine Check Exception feature is supported.\r | |
537 | @retval FALSE Machine Check Exception feature is not supported.\r | |
538 | \r | |
539 | @note This service could be called by BSP/APs.\r | |
540 | **/\r | |
541 | BOOLEAN\r | |
542 | EFIAPI\r | |
543 | MceSupport (\r | |
544 | IN UINTN ProcessorNumber,\r | |
545 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
546 | IN VOID *ConfigData OPTIONAL\r | |
547 | );\r | |
548 | \r | |
549 | /**\r | |
550 | Initializes Machine Check Exception feature to specific state.\r | |
551 | \r | |
552 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
553 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
554 | structure for the CPU executing this function.\r | |
555 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
556 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
557 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
558 | RegisterCpuFeature().\r | |
559 | @param[in] State If TRUE, then the Machine Check Exception feature must be enabled.\r | |
560 | If FALSE, then the Machine Check Exception feature must be disabled.\r | |
561 | \r | |
562 | @retval RETURN_SUCCESS Machine Check Exception feature is initialized.\r | |
563 | \r | |
564 | @note This service could be called by BSP only.\r | |
565 | **/\r | |
566 | RETURN_STATUS\r | |
567 | EFIAPI\r | |
568 | MceInitialize (\r | |
569 | IN UINTN ProcessorNumber,\r | |
570 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
571 | IN VOID *ConfigData, OPTIONAL\r | |
572 | IN BOOLEAN State\r | |
573 | );\r | |
574 | \r | |
575 | /**\r | |
576 | Detects if Machine Check Architecture feature supported on current processor.\r | |
577 | \r | |
578 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
579 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
580 | structure for the CPU executing this function.\r | |
581 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
582 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
583 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
584 | RegisterCpuFeature().\r | |
585 | \r | |
586 | @retval TRUE Machine Check Architecture feature is supported.\r | |
587 | @retval FALSE Machine Check Architecture feature is not supported.\r | |
588 | \r | |
589 | @note This service could be called by BSP/APs.\r | |
590 | **/\r | |
591 | BOOLEAN\r | |
592 | EFIAPI\r | |
593 | McaSupport (\r | |
594 | IN UINTN ProcessorNumber,\r | |
595 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
596 | IN VOID *ConfigData OPTIONAL\r | |
597 | );\r | |
598 | \r | |
599 | /**\r | |
600 | Initializes Machine Check Architecture feature to specific state.\r | |
601 | \r | |
602 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
603 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
604 | structure for the CPU executing this function.\r | |
605 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
606 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
607 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
608 | RegisterCpuFeature().\r | |
609 | @param[in] State If TRUE, then the Machine Check Architecture feature must be enabled.\r | |
610 | If FALSE, then the Machine Check Architecture feature must be disabled.\r | |
611 | \r | |
612 | @retval RETURN_SUCCESS Machine Check Architecture feature is initialized.\r | |
613 | \r | |
614 | @note This service could be called by BSP only.\r | |
615 | **/\r | |
616 | RETURN_STATUS\r | |
617 | EFIAPI\r | |
618 | McaInitialize (\r | |
619 | IN UINTN ProcessorNumber,\r | |
620 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
621 | IN VOID *ConfigData, OPTIONAL\r | |
622 | IN BOOLEAN State\r | |
623 | );\r | |
624 | \r | |
625 | /**\r | |
626 | Detects if IA32_MCG_CTL feature supported on current processor.\r | |
627 | \r | |
628 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
629 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
630 | structure for the CPU executing this function.\r | |
631 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
632 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
633 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
634 | RegisterCpuFeature().\r | |
635 | \r | |
636 | @retval TRUE IA32_MCG_CTL feature is supported.\r | |
637 | @retval FALSE IA32_MCG_CTL feature is not supported.\r | |
638 | \r | |
639 | @note This service could be called by BSP/APs.\r | |
640 | **/\r | |
641 | BOOLEAN\r | |
642 | EFIAPI\r | |
643 | McgCtlSupport (\r | |
644 | IN UINTN ProcessorNumber,\r | |
645 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
646 | IN VOID *ConfigData OPTIONAL\r | |
647 | );\r | |
648 | \r | |
649 | /**\r | |
650 | Initializes IA32_MCG_CTL feature to specific state.\r | |
651 | \r | |
652 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
653 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
654 | structure for the CPU executing this function.\r | |
655 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
656 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
657 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
658 | RegisterCpuFeature().\r | |
659 | @param[in] State If TRUE, then the IA32_MCG_CTL feature must be enabled.\r | |
660 | If FALSE, then the IA32_MCG_CTL feature must be disabled.\r | |
661 | \r | |
662 | @retval RETURN_SUCCESS IA32_MCG_CTL feature is initialized.\r | |
663 | \r | |
664 | @note This service could be called by BSP only.\r | |
665 | **/\r | |
666 | RETURN_STATUS\r | |
667 | EFIAPI\r | |
668 | McgCtlInitialize (\r | |
669 | IN UINTN ProcessorNumber,\r | |
670 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
671 | IN VOID *ConfigData, OPTIONAL\r | |
672 | IN BOOLEAN State\r | |
673 | );\r | |
674 | \r | |
675 | /**\r | |
676 | Detects if Pending Break feature supported on current processor.\r | |
677 | \r | |
678 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
679 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
680 | structure for the CPU executing this function.\r | |
681 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
682 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
683 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
684 | RegisterCpuFeature().\r | |
685 | \r | |
686 | @retval TRUE Pending Break feature is supported.\r | |
687 | @retval FALSE Pending Break feature is not supported.\r | |
688 | \r | |
689 | @note This service could be called by BSP/APs.\r | |
690 | **/\r | |
691 | BOOLEAN\r | |
692 | EFIAPI\r | |
693 | PendingBreakSupport (\r | |
694 | IN UINTN ProcessorNumber,\r | |
695 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
696 | IN VOID *ConfigData OPTIONAL\r | |
697 | );\r | |
698 | \r | |
699 | /**\r | |
700 | Initializes Pending Break feature to specific state.\r | |
701 | \r | |
702 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
703 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
704 | structure for the CPU executing this function.\r | |
705 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
706 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
707 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
708 | RegisterCpuFeature().\r | |
709 | @param[in] State If TRUE, then the Pending Break feature must be enabled.\r | |
710 | If FALSE, then the Pending Break feature must be disabled.\r | |
711 | \r | |
712 | @retval RETURN_SUCCESS Pending Break feature is initialized.\r | |
713 | \r | |
714 | @note This service could be called by BSP only.\r | |
715 | **/\r | |
716 | RETURN_STATUS\r | |
717 | EFIAPI\r | |
718 | PendingBreakInitialize (\r | |
719 | IN UINTN ProcessorNumber,\r | |
720 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
721 | IN VOID *ConfigData, OPTIONAL\r | |
722 | IN BOOLEAN State\r | |
723 | );\r | |
724 | \r | |
725 | /**\r | |
726 | Detects if C1E feature supported on current processor.\r | |
727 | \r | |
728 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
729 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
730 | structure for the CPU executing this function.\r | |
731 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
732 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
733 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
734 | RegisterCpuFeature().\r | |
735 | \r | |
736 | @retval TRUE C1E feature is supported.\r | |
737 | @retval FALSE C1E feature is not supported.\r | |
738 | \r | |
739 | @note This service could be called by BSP/APs.\r | |
740 | **/\r | |
741 | BOOLEAN\r | |
742 | EFIAPI\r | |
743 | C1eSupport (\r | |
744 | IN UINTN ProcessorNumber,\r | |
745 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
746 | IN VOID *ConfigData OPTIONAL\r | |
747 | );\r | |
748 | \r | |
749 | /**\r | |
750 | Initializes C1E feature to specific state.\r | |
751 | \r | |
752 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
753 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
754 | structure for the CPU executing this function.\r | |
755 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
756 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
757 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
758 | RegisterCpuFeature().\r | |
759 | @param[in] State If TRUE, then the C1E feature must be enabled.\r | |
760 | If FALSE, then the C1E feature must be disabled.\r | |
761 | \r | |
762 | @retval RETURN_SUCCESS C1E feature is initialized.\r | |
763 | \r | |
764 | @note This service could be called by BSP only.\r | |
765 | **/\r | |
766 | RETURN_STATUS\r | |
767 | EFIAPI\r | |
768 | C1eInitialize (\r | |
769 | IN UINTN ProcessorNumber,\r | |
770 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
771 | IN VOID *ConfigData, OPTIONAL\r | |
772 | IN BOOLEAN State\r | |
773 | );\r | |
774 | \r | |
6661abb6 JF |
775 | /**\r |
776 | Prepares for the data used by CPU feature detection and initialization.\r | |
777 | \r | |
778 | @param[in] NumberOfProcessors The number of CPUs in the platform.\r | |
779 | \r | |
780 | @return Pointer to a buffer of CPU related configuration data.\r | |
781 | \r | |
782 | @note This service could be called by BSP only.\r | |
783 | **/\r | |
784 | VOID *\r | |
785 | EFIAPI\r | |
786 | X2ApicGetConfigData (\r | |
787 | IN UINTN NumberOfProcessors\r | |
788 | );\r | |
789 | \r | |
80c4b236 JF |
790 | /**\r |
791 | Detects if X2Apci feature supported on current processor.\r | |
792 | \r | |
793 | Detect if X2Apci has been already enabled.\r | |
794 | \r | |
795 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
796 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
797 | structure for the CPU executing this function.\r | |
798 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
799 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
800 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
801 | RegisterCpuFeature().\r | |
802 | \r | |
803 | @retval TRUE X2Apci feature is supported.\r | |
804 | @retval FALSE X2Apci feature is not supported.\r | |
805 | \r | |
806 | @note This service could be called by BSP/APs.\r | |
807 | **/\r | |
808 | BOOLEAN\r | |
809 | EFIAPI\r | |
810 | X2ApicSupport (\r | |
811 | IN UINTN ProcessorNumber,\r | |
812 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
813 | IN VOID *ConfigData OPTIONAL\r | |
814 | );\r | |
815 | \r | |
816 | /**\r | |
817 | Initializes X2Apci feature to specific state.\r | |
818 | \r | |
819 | @param[in] ProcessorNumber The index of the CPU executing this function.\r | |
820 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r | |
821 | structure for the CPU executing this function.\r | |
822 | @param[in] ConfigData A pointer to the configuration buffer returned\r | |
823 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r | |
824 | CPU_FEATURE_GET_CONFIG_DATA was not provided in\r | |
825 | RegisterCpuFeature().\r | |
826 | @param[in] State If TRUE, then the X2Apci feature must be enabled.\r | |
827 | If FALSE, then the X2Apci feature must be disabled.\r | |
828 | \r | |
829 | @retval RETURN_SUCCESS X2Apci feature is initialized.\r | |
830 | \r | |
831 | @note This service could be called by BSP only.\r | |
832 | **/\r | |
833 | RETURN_STATUS\r | |
834 | EFIAPI\r | |
835 | X2ApicInitialize (\r | |
836 | IN UINTN ProcessorNumber,\r | |
837 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r | |
838 | IN VOID *ConfigData, OPTIONAL\r | |
839 | IN BOOLEAN State\r | |
840 | );\r | |
841 | \r | |
842 | /**\r | |
843 | Prepares for the data used by CPU feature detection and initialization.\r | |
844 | \r | |
845 | @param[in] NumberOfProcessors The number of CPUs in the platform.\r | |
846 | \r | |
847 | @return Pointer to a buffer of CPU related configuration data.\r | |
848 | \r | |
849 | @note This service could be called by BSP only.\r | |
850 | **/\r | |
851 | VOID *\r | |
852 | EFIAPI\r | |
853 | FeatureControlGetConfigData (\r | |
854 | IN UINTN NumberOfProcessors\r | |
855 | );\r | |
856 | \r | |
857 | #endif\r |