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