]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().
[mirror_edk2.git] / UefiCpuPkg / Library / CpuCommonFeaturesLib / CpuCommonFeatures.h
CommitLineData
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
40VOID *\r
41EFIAPI\r
42AesniGetConfigData (\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
62BOOLEAN\r
63EFIAPI\r
64AesniSupport (\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
87RETURN_STATUS\r
88EFIAPI\r
89AesniInitialize (\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
112BOOLEAN\r
113EFIAPI\r
114ClockModulationSupport (\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
137RETURN_STATUS\r
138EFIAPI\r
139ClockModulationInitialize (\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
162BOOLEAN\r
163EFIAPI\r
164EistSupport (\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
189RETURN_STATUS\r
190EFIAPI\r
191EistInitialize (\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
214BOOLEAN\r
215EFIAPI\r
216ExecuteDisableSupport (\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
239RETURN_STATUS\r
240EFIAPI\r
241ExecuteDisableInitialize (\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
265RETURN_STATUS\r
266EFIAPI\r
267FastStringsInitialize (\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
290BOOLEAN\r
291EFIAPI\r
292MonitorMwaitSupport (\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
315RETURN_STATUS\r
316EFIAPI\r
317MonitorMwaitInitialize (\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
340BOOLEAN\r
341EFIAPI\r
342VmxSupport (\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
365RETURN_STATUS\r
366EFIAPI\r
b1fe2029 367VmxInitialize (\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
390BOOLEAN\r
391EFIAPI\r
392LockFeatureControlRegisterSupport (\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
415RETURN_STATUS\r
416EFIAPI\r
417LockFeatureControlRegisterInitialize (\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
440BOOLEAN\r
441EFIAPI\r
442SmxSupport (\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
466RETURN_STATUS\r
467EFIAPI\r
b1fe2029 468SmxInitialize (\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
491BOOLEAN\r
492EFIAPI\r
493LimitCpuidMaxvalSupport (\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
516RETURN_STATUS\r
517EFIAPI\r
518LimitCpuidMaxvalInitialize (\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
541BOOLEAN\r
542EFIAPI\r
543MceSupport (\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
566RETURN_STATUS\r
567EFIAPI\r
568MceInitialize (\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
591BOOLEAN\r
592EFIAPI\r
593McaSupport (\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
616RETURN_STATUS\r
617EFIAPI\r
618McaInitialize (\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
641BOOLEAN\r
642EFIAPI\r
643McgCtlSupport (\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
666RETURN_STATUS\r
667EFIAPI\r
668McgCtlInitialize (\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
691BOOLEAN\r
692EFIAPI\r
693PendingBreakSupport (\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
716RETURN_STATUS\r
717EFIAPI\r
718PendingBreakInitialize (\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
741BOOLEAN\r
742EFIAPI\r
743C1eSupport (\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
766RETURN_STATUS\r
767EFIAPI\r
768C1eInitialize (\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
784VOID *\r
785EFIAPI\r
786X2ApicGetConfigData (\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
808BOOLEAN\r
809EFIAPI\r
810X2ApicSupport (\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
833RETURN_STATUS\r
834EFIAPI\r
835X2ApicInitialize (\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
851VOID *\r
852EFIAPI\r
853FeatureControlGetConfigData (\r
854 IN UINTN NumberOfProcessors\r
855 );\r
856\r
ee1d736a
ED
857/**\r
858 Detects if Protected Processor Inventory Number feature supported on current \r
859 processor.\r
860\r
861 @param[in] ProcessorNumber The index of the CPU executing this function.\r
862 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
863 structure for the CPU executing this function.\r
864 @param[in] ConfigData A pointer to the configuration buffer returned\r
865 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
866 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
867 RegisterCpuFeature().\r
868\r
91ec57c4
MH
869 @retval TRUE Protected Processor Inventory Number feature is supported.\r
870 @retval FALSE Protected Processor Inventory Number feature is not supported.\r
ee1d736a
ED
871\r
872 @note This service could be called by BSP/APs.\r
873**/\r
874BOOLEAN\r
875EFIAPI\r
876PpinSupport (\r
877 IN UINTN ProcessorNumber,\r
878 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
879 IN VOID *ConfigData OPTIONAL\r
880 );\r
881\r
882/**\r
883 Initializes Protected Processor Inventory Number feature to specific state.\r
884\r
885 @param[in] ProcessorNumber The index of the CPU executing this function.\r
886 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
887 structure for the CPU executing this function.\r
888 @param[in] ConfigData A pointer to the configuration buffer returned\r
889 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
890 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
891 RegisterCpuFeature().\r
892 @param[in] State If TRUE, then the Protected Processor Inventory \r
893 Number feature must be enabled.\r
894 If FALSE, then the Protected Processor Inventory \r
895 Number feature must be disabled.\r
896\r
897 @retval RETURN_SUCCESS Protected Processor Inventory Number feature is \r
898 initialized.\r
899 @retval RETURN_DEVICE_ERROR Device can't change state because it has been \r
900 locked.\r
901\r
902**/\r
903RETURN_STATUS\r
904EFIAPI\r
905PpinInitialize (\r
906 IN UINTN ProcessorNumber,\r
907 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
908 IN VOID *ConfigData, OPTIONAL\r
909 IN BOOLEAN State\r
910 );\r
911\r
80c4b236 912#endif\r