2 CPU Features PEIM driver to initialize CPU features.
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
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.
17 #include <Library/BaseLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/PeiServicesLib.h>
20 #include <Library/RegisterCpuFeaturesLib.h>
22 #include <Guid/CpuFeaturesInitDone.h>
24 EFI_PEI_PPI_DESCRIPTOR mPeiCpuFeaturesInitDonePpiDesc
= {
25 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
26 &gEdkiiCpuFeaturesInitDoneGuid
,
31 CPU Features driver entry point function.
33 It will perform CPU features initialization, except for
34 PcdCpuFeaturesInitOnS3Resume is FALSE on S3 resume.
36 @param FileHandle Handle of the file being invoked.
37 @param PeiServices Describes the list of possible PEI Services.
39 @retval EFI_SUCCESS CPU Features is initialized successfully.
43 CpuFeaturesPeimInitialize (
44 IN EFI_PEI_FILE_HANDLE FileHandle
,
45 IN CONST EFI_PEI_SERVICES
**PeiServices
49 EFI_BOOT_MODE BootMode
;
51 Status
= PeiServicesGetBootMode (&BootMode
);
52 ASSERT_EFI_ERROR (Status
);
54 if (BootMode
== BOOT_ON_S3_RESUME
&&
55 !PcdGetBool (PcdCpuFeaturesInitOnS3Resume
)) {
57 // Does nothing when if PcdCpuFeaturesInitOnS3Resume is FLASE
65 CpuFeaturesInitialize ();
68 // Install CPU Features Init Done PPI
70 Status
= PeiServicesInstallPpi(&mPeiCpuFeaturesInitDonePpiDesc
);
71 ASSERT_EFI_ERROR (Status
);