]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
UefiCpuPkg/CpuFeatures: Change files format to DOS
[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
349 Initializes VMX inside SMX feature to specific state.\r
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
358 @param[in] State If TRUE, then the VMX inside SMX feature must be enabled.\r
359 If FALSE, then the VMX inside SMX feature must be disabled.\r
360\r
361 @retval RETURN_SUCCESS VMX inside SMX feature is initialized.\r
362\r
363 @note This service could be called by BSP only.\r
364**/\r
365RETURN_STATUS\r
366EFIAPI\r
367VmxInsideSmxInitialize (\r
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 Initializes SENTER feature to specific state.\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 @param[in] State If TRUE, then the SENTER feature must be enabled.\r
385 If FALSE, then the SENTER feature must be disabled.\r
386\r
387 @retval RETURN_SUCCESS SENTER feature is initialized.\r
388\r
389 @note This service could be called by BSP only.\r
390**/\r
391RETURN_STATUS\r
392EFIAPI\r
393SenterInitialize (\r
394 IN UINTN ProcessorNumber,\r
395 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
396 IN VOID *ConfigData, OPTIONAL\r
397 IN BOOLEAN State\r
398 );\r
399\r
400/**\r
401 Detects if Lock Feature Control Register feature supported on current processor.\r
402\r
403 @param[in] ProcessorNumber The index of the CPU executing this function.\r
404 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
405 structure for the CPU executing this function.\r
406 @param[in] ConfigData A pointer to the configuration buffer returned\r
407 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
408 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
409 RegisterCpuFeature().\r
410\r
411 @retval TRUE Lock Feature Control Register feature is supported.\r
412 @retval FALSE Lock Feature Control Register feature is not supported.\r
413\r
414 @note This service could be called by BSP/APs.\r
415**/\r
416BOOLEAN\r
417EFIAPI\r
418LockFeatureControlRegisterSupport (\r
419 IN UINTN ProcessorNumber,\r
420 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
421 IN VOID *ConfigData OPTIONAL\r
422 );\r
423\r
424/**\r
425 Initializes Lock Feature Control Register feature to specific state.\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 @param[in] State If TRUE, then the Lock Feature Control Register feature must be enabled.\r
435 If FALSE, then the Lock Feature Control Register feature must be disabled.\r
436\r
437 @retval RETURN_SUCCESS Lock Feature Control Register feature is initialized.\r
438\r
439 @note This service could be called by BSP only.\r
440**/\r
441RETURN_STATUS\r
442EFIAPI\r
443LockFeatureControlRegisterInitialize (\r
444 IN UINTN ProcessorNumber,\r
445 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
446 IN VOID *ConfigData, OPTIONAL\r
447 IN BOOLEAN State\r
448 );\r
449\r
450/**\r
451 Detects if SMX feature supported on current processor.\r
452\r
453 @param[in] ProcessorNumber The index of the CPU executing this function.\r
454 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
455 structure for the CPU executing this function.\r
456 @param[in] ConfigData A pointer to the configuration buffer returned\r
457 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
458 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
459 RegisterCpuFeature().\r
460\r
461 @retval TRUE SMX feature is supported.\r
462 @retval FALSE SMX feature is not supported.\r
463\r
464 @note This service could be called by BSP/APs.\r
465**/\r
466BOOLEAN\r
467EFIAPI\r
468SmxSupport (\r
469 IN UINTN ProcessorNumber,\r
470 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
471 IN VOID *ConfigData OPTIONAL\r
472 );\r
473\r
474/**\r
475 Initializes VMX outside SMX feature to specific state.\r
476\r
477 @param[in] ProcessorNumber The index of the CPU executing this function.\r
478 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
479 structure for the CPU executing this function.\r
480 @param[in] ConfigData A pointer to the configuration buffer returned\r
481 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
482 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
483 RegisterCpuFeature().\r
484 @param[in] State If TRUE, then the VMX outside SMX feature must be enabled.\r
485 If FALSE, then the VMX outside SMX feature must be disabled.\r
486\r
487 @retval RETURN_SUCCESS VMX outside SMX feature is initialized.\r
488\r
489 @note This service could be called by BSP only.\r
490**/\r
491RETURN_STATUS\r
492EFIAPI\r
493VmxOutsideSmxInitialize (\r
494 IN UINTN ProcessorNumber,\r
495 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
496 IN VOID *ConfigData, OPTIONAL\r
497 IN BOOLEAN State\r
498 );\r
499\r
500/**\r
501 Detects if LimitCpuidMaxval feature supported on current processor.\r
502\r
503 @param[in] ProcessorNumber The index of the CPU executing this function.\r
504 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
505 structure for the CPU executing this function.\r
506 @param[in] ConfigData A pointer to the configuration buffer returned\r
507 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
508 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
509 RegisterCpuFeature().\r
510\r
511 @retval TRUE LimitCpuidMaxval feature is supported.\r
512 @retval FALSE LimitCpuidMaxval feature is not supported.\r
513\r
514 @note This service could be called by BSP/APs.\r
515**/\r
516BOOLEAN\r
517EFIAPI\r
518LimitCpuidMaxvalSupport (\r
519 IN UINTN ProcessorNumber,\r
520 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
521 IN VOID *ConfigData OPTIONAL\r
522 );\r
523\r
524/**\r
525 Initializes LimitCpuidMaxval feature to specific state.\r
526\r
527 @param[in] ProcessorNumber The index of the CPU executing this function.\r
528 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
529 structure for the CPU executing this function.\r
530 @param[in] ConfigData A pointer to the configuration buffer returned\r
531 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
532 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
533 RegisterCpuFeature().\r
534 @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.\r
535 If FALSE, then the LimitCpuidMaxval feature must be disabled.\r
536\r
537 @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.\r
538\r
539 @note This service could be called by BSP only.\r
540**/\r
541RETURN_STATUS\r
542EFIAPI\r
543LimitCpuidMaxvalInitialize (\r
544 IN UINTN ProcessorNumber,\r
545 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
546 IN VOID *ConfigData, OPTIONAL\r
547 IN BOOLEAN State\r
548 );\r
549\r
550/**\r
551 Detects if Machine Check Exception feature supported on current processor.\r
552\r
553 @param[in] ProcessorNumber The index of the CPU executing this function.\r
554 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
555 structure for the CPU executing this function.\r
556 @param[in] ConfigData A pointer to the configuration buffer returned\r
557 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
558 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
559 RegisterCpuFeature().\r
560\r
561 @retval TRUE Machine Check Exception feature is supported.\r
562 @retval FALSE Machine Check Exception feature is not supported.\r
563\r
564 @note This service could be called by BSP/APs.\r
565**/\r
566BOOLEAN\r
567EFIAPI\r
568MceSupport (\r
569 IN UINTN ProcessorNumber,\r
570 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
571 IN VOID *ConfigData OPTIONAL\r
572 );\r
573\r
574/**\r
575 Initializes Machine Check Exception feature to specific state.\r
576\r
577 @param[in] ProcessorNumber The index of the CPU executing this function.\r
578 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
579 structure for the CPU executing this function.\r
580 @param[in] ConfigData A pointer to the configuration buffer returned\r
581 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
582 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
583 RegisterCpuFeature().\r
584 @param[in] State If TRUE, then the Machine Check Exception feature must be enabled.\r
585 If FALSE, then the Machine Check Exception feature must be disabled.\r
586\r
587 @retval RETURN_SUCCESS Machine Check Exception feature is initialized.\r
588\r
589 @note This service could be called by BSP only.\r
590**/\r
591RETURN_STATUS\r
592EFIAPI\r
593MceInitialize (\r
594 IN UINTN ProcessorNumber,\r
595 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
596 IN VOID *ConfigData, OPTIONAL\r
597 IN BOOLEAN State\r
598 );\r
599\r
600/**\r
601 Detects if Machine Check Architecture feature supported on current processor.\r
602\r
603 @param[in] ProcessorNumber The index of the CPU executing this function.\r
604 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
605 structure for the CPU executing this function.\r
606 @param[in] ConfigData A pointer to the configuration buffer returned\r
607 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
608 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
609 RegisterCpuFeature().\r
610\r
611 @retval TRUE Machine Check Architecture feature is supported.\r
612 @retval FALSE Machine Check Architecture feature is not supported.\r
613\r
614 @note This service could be called by BSP/APs.\r
615**/\r
616BOOLEAN\r
617EFIAPI\r
618McaSupport (\r
619 IN UINTN ProcessorNumber,\r
620 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
621 IN VOID *ConfigData OPTIONAL\r
622 );\r
623\r
624/**\r
625 Initializes Machine Check Architecture feature to specific state.\r
626\r
627 @param[in] ProcessorNumber The index of the CPU executing this function.\r
628 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
629 structure for the CPU executing this function.\r
630 @param[in] ConfigData A pointer to the configuration buffer returned\r
631 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
632 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
633 RegisterCpuFeature().\r
634 @param[in] State If TRUE, then the Machine Check Architecture feature must be enabled.\r
635 If FALSE, then the Machine Check Architecture feature must be disabled.\r
636\r
637 @retval RETURN_SUCCESS Machine Check Architecture feature is initialized.\r
638\r
639 @note This service could be called by BSP only.\r
640**/\r
641RETURN_STATUS\r
642EFIAPI\r
643McaInitialize (\r
644 IN UINTN ProcessorNumber,\r
645 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
646 IN VOID *ConfigData, OPTIONAL\r
647 IN BOOLEAN State\r
648 );\r
649\r
650/**\r
651 Detects if IA32_MCG_CTL feature supported on current processor.\r
652\r
653 @param[in] ProcessorNumber The index of the CPU executing this function.\r
654 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
655 structure for the CPU executing this function.\r
656 @param[in] ConfigData A pointer to the configuration buffer returned\r
657 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
658 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
659 RegisterCpuFeature().\r
660\r
661 @retval TRUE IA32_MCG_CTL feature is supported.\r
662 @retval FALSE IA32_MCG_CTL feature is not supported.\r
663\r
664 @note This service could be called by BSP/APs.\r
665**/\r
666BOOLEAN\r
667EFIAPI\r
668McgCtlSupport (\r
669 IN UINTN ProcessorNumber,\r
670 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
671 IN VOID *ConfigData OPTIONAL\r
672 );\r
673\r
674/**\r
675 Initializes IA32_MCG_CTL feature to specific state.\r
676\r
677 @param[in] ProcessorNumber The index of the CPU executing this function.\r
678 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
679 structure for the CPU executing this function.\r
680 @param[in] ConfigData A pointer to the configuration buffer returned\r
681 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
682 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
683 RegisterCpuFeature().\r
684 @param[in] State If TRUE, then the IA32_MCG_CTL feature must be enabled.\r
685 If FALSE, then the IA32_MCG_CTL feature must be disabled.\r
686\r
687 @retval RETURN_SUCCESS IA32_MCG_CTL feature is initialized.\r
688\r
689 @note This service could be called by BSP only.\r
690**/\r
691RETURN_STATUS\r
692EFIAPI\r
693McgCtlInitialize (\r
694 IN UINTN ProcessorNumber,\r
695 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
696 IN VOID *ConfigData, OPTIONAL\r
697 IN BOOLEAN State\r
698 );\r
699\r
700/**\r
701 Detects if Pending Break feature supported on current processor.\r
702\r
703 @param[in] ProcessorNumber The index of the CPU executing this function.\r
704 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
705 structure for the CPU executing this function.\r
706 @param[in] ConfigData A pointer to the configuration buffer returned\r
707 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
708 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
709 RegisterCpuFeature().\r
710\r
711 @retval TRUE Pending Break feature is supported.\r
712 @retval FALSE Pending Break feature is not supported.\r
713\r
714 @note This service could be called by BSP/APs.\r
715**/\r
716BOOLEAN\r
717EFIAPI\r
718PendingBreakSupport (\r
719 IN UINTN ProcessorNumber,\r
720 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
721 IN VOID *ConfigData OPTIONAL\r
722 );\r
723\r
724/**\r
725 Initializes Pending Break feature to specific state.\r
726\r
727 @param[in] ProcessorNumber The index of the CPU executing this function.\r
728 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
729 structure for the CPU executing this function.\r
730 @param[in] ConfigData A pointer to the configuration buffer returned\r
731 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
732 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
733 RegisterCpuFeature().\r
734 @param[in] State If TRUE, then the Pending Break feature must be enabled.\r
735 If FALSE, then the Pending Break feature must be disabled.\r
736\r
737 @retval RETURN_SUCCESS Pending Break feature is initialized.\r
738\r
739 @note This service could be called by BSP only.\r
740**/\r
741RETURN_STATUS\r
742EFIAPI\r
743PendingBreakInitialize (\r
744 IN UINTN ProcessorNumber,\r
745 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
746 IN VOID *ConfigData, OPTIONAL\r
747 IN BOOLEAN State\r
748 );\r
749\r
750/**\r
751 Detects if C1E feature supported on current processor.\r
752\r
753 @param[in] ProcessorNumber The index of the CPU executing this function.\r
754 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
755 structure for the CPU executing this function.\r
756 @param[in] ConfigData A pointer to the configuration buffer returned\r
757 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
758 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
759 RegisterCpuFeature().\r
760\r
761 @retval TRUE C1E feature is supported.\r
762 @retval FALSE C1E feature is not supported.\r
763\r
764 @note This service could be called by BSP/APs.\r
765**/\r
766BOOLEAN\r
767EFIAPI\r
768C1eSupport (\r
769 IN UINTN ProcessorNumber,\r
770 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
771 IN VOID *ConfigData OPTIONAL\r
772 );\r
773\r
774/**\r
775 Initializes C1E feature to specific state.\r
776\r
777 @param[in] ProcessorNumber The index of the CPU executing this function.\r
778 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
779 structure for the CPU executing this function.\r
780 @param[in] ConfigData A pointer to the configuration buffer returned\r
781 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
782 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
783 RegisterCpuFeature().\r
784 @param[in] State If TRUE, then the C1E feature must be enabled.\r
785 If FALSE, then the C1E feature must be disabled.\r
786\r
787 @retval RETURN_SUCCESS C1E feature is initialized.\r
788\r
789 @note This service could be called by BSP only.\r
790**/\r
791RETURN_STATUS\r
792EFIAPI\r
793C1eInitialize (\r
794 IN UINTN ProcessorNumber,\r
795 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
796 IN VOID *ConfigData, OPTIONAL\r
797 IN BOOLEAN State\r
798 );\r
799\r
800/**\r
801 Detects if X2Apci feature supported on current processor.\r
802\r
803 Detect if X2Apci has been already enabled.\r
804\r
805 @param[in] ProcessorNumber The index of the CPU executing this function.\r
806 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
807 structure for the CPU executing this function.\r
808 @param[in] ConfigData A pointer to the configuration buffer returned\r
809 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
810 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
811 RegisterCpuFeature().\r
812\r
813 @retval TRUE X2Apci feature is supported.\r
814 @retval FALSE X2Apci feature is not supported.\r
815\r
816 @note This service could be called by BSP/APs.\r
817**/\r
818BOOLEAN\r
819EFIAPI\r
820X2ApicSupport (\r
821 IN UINTN ProcessorNumber,\r
822 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
823 IN VOID *ConfigData OPTIONAL\r
824 );\r
825\r
826/**\r
827 Initializes X2Apci feature to specific state.\r
828\r
829 @param[in] ProcessorNumber The index of the CPU executing this function.\r
830 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION\r
831 structure for the CPU executing this function.\r
832 @param[in] ConfigData A pointer to the configuration buffer returned\r
833 by CPU_FEATURE_GET_CONFIG_DATA. NULL if\r
834 CPU_FEATURE_GET_CONFIG_DATA was not provided in\r
835 RegisterCpuFeature().\r
836 @param[in] State If TRUE, then the X2Apci feature must be enabled.\r
837 If FALSE, then the X2Apci feature must be disabled.\r
838\r
839 @retval RETURN_SUCCESS X2Apci feature is initialized.\r
840\r
841 @note This service could be called by BSP only.\r
842**/\r
843RETURN_STATUS\r
844EFIAPI\r
845X2ApicInitialize (\r
846 IN UINTN ProcessorNumber,\r
847 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,\r
848 IN VOID *ConfigData, OPTIONAL\r
849 IN BOOLEAN State\r
850 );\r
851\r
852/**\r
853 Prepares for the data used by CPU feature detection and initialization.\r
854\r
855 @param[in] NumberOfProcessors The number of CPUs in the platform.\r
856\r
857 @return Pointer to a buffer of CPU related configuration data.\r
858\r
859 @note This service could be called by BSP only.\r
860**/\r
861VOID *\r
862EFIAPI\r
863FeatureControlGetConfigData (\r
864 IN UINTN NumberOfProcessors\r
865 );\r
866\r
867#endif\r