Worker function to save PcdCpuFeaturesCapability.\r
\r
@param[in] SupportedFeatureMask The pointer to CPU feature bits mask buffer\r
+ @param[in] FeatureMaskSize CPU feature bits mask buffer size.\r
+\r
**/\r
VOID\r
SetCapabilityPcd (\r
- IN UINT8 *SupportedFeatureMask\r
+ IN UINT8 *SupportedFeatureMask,\r
+ IN UINT32 FeatureMaskSize\r
)\r
{\r
EFI_STATUS Status;\r
UINTN BitMaskSize;\r
\r
BitMaskSize = PcdGetSize (PcdCpuFeaturesCapability);\r
+ ASSERT (FeatureMaskSize == BitMaskSize);\r
+\r
Status = PcdSetPtrS (PcdCpuFeaturesCapability, &BitMaskSize, SupportedFeatureMask);\r
ASSERT_EFI_ERROR (Status);\r
}\r
ASSERT_EFI_ERROR (Status);\r
}\r
\r
-/**\r
- Worker function to get PcdCpuFeaturesSupport.\r
-\r
- @return The pointer to CPU feature bits mask buffer.\r
-**/\r
-UINT8 *\r
-GetSupportPcd (\r
- VOID\r
- )\r
-{\r
- UINT8 *SupportBitMask;\r
-\r
- SupportBitMask = AllocateCopyPool (\r
- PcdGetSize (PcdCpuFeaturesSupport),\r
- PcdGetPtr (PcdCpuFeaturesSupport)\r
- );\r
- ASSERT (SupportBitMask != NULL);\r
-\r
- return SupportBitMask;\r
-}\r
-\r
-/**\r
- Worker function to get PcdCpuFeaturesUserConfiguration.\r
-\r
- @return The pointer to CPU feature bits mask buffer.\r
-**/\r
-UINT8 *\r
-GetConfigurationPcd (\r
- VOID\r
- )\r
-{\r
- UINT8 *SupportBitMask;\r
-\r
- SupportBitMask = AllocateCopyPool (\r
- PcdGetSize (PcdCpuFeaturesUserConfiguration),\r
- PcdGetPtr (PcdCpuFeaturesUserConfiguration)\r
- );\r
- ASSERT (SupportBitMask != NULL);\r
-\r
- return SupportBitMask;\r
-}\r
-\r
/**\r
Collects CPU type and feature information.\r
\r
// Get support and configuration PCDs\r
//\r
CpuFeaturesData->SupportPcd = GetSupportPcd ();\r
- CpuFeaturesData->ConfigurationPcd = GetConfigurationPcd ();\r
}\r
\r
/**\r
**/\r
VOID\r
SupportedMaskAnd (\r
- IN UINT8 *SupportedFeatureMask,\r
- IN UINT8 *AndFeatureBitMask\r
+ IN UINT8 *SupportedFeatureMask,\r
+ IN CONST UINT8 *AndFeatureBitMask\r
)\r
{\r
UINTN Index;\r
UINTN BitMaskSize;\r
UINT8 *Data1;\r
- UINT8 *Data2;\r
+ CONST UINT8 *Data2;\r
\r
BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport);\r
Data1 = SupportedFeatureMask;\r
//\r
// Calculate the last setting\r
//\r
-\r
CpuFeaturesData->SettingPcd = AllocateCopyPool (CpuFeaturesData->BitMaskSize, CpuFeaturesData->CapabilityPcd);\r
ASSERT (CpuFeaturesData->SettingPcd != NULL);\r
- SupportedMaskAnd (CpuFeaturesData->SettingPcd, CpuFeaturesData->ConfigurationPcd);\r
-\r
- //\r
- // Save PCDs and display CPU PCDs\r
- //\r
- SetCapabilityPcd (CpuFeaturesData->CapabilityPcd);\r
- SetSettingPcd (CpuFeaturesData->SettingPcd);\r
+ SupportedMaskAnd (CpuFeaturesData->SettingPcd, PcdGetPtr (PcdCpuFeaturesSetting));\r
\r
//\r
// Dump the last CPU feature list\r
}\r
DEBUG ((DEBUG_INFO, "PcdCpuFeaturesSupport:\n"));\r
DumpCpuFeatureMask (CpuFeaturesData->SupportPcd);\r
- DEBUG ((DEBUG_INFO, "PcdCpuFeaturesUserConfiguration:\n"));\r
- DumpCpuFeatureMask (CpuFeaturesData->ConfigurationPcd);\r
DEBUG ((DEBUG_INFO, "PcdCpuFeaturesCapability:\n"));\r
DumpCpuFeatureMask (CpuFeaturesData->CapabilityPcd);\r
- DEBUG ((DEBUG_INFO, "PcdCpuFeaturesSetting:\n"));\r
+ DEBUG ((DEBUG_INFO, "Origin PcdCpuFeaturesSetting:\n"));\r
+ DumpCpuFeatureMask (PcdGetPtr (PcdCpuFeaturesSetting));\r
+ DEBUG ((DEBUG_INFO, "Final PcdCpuFeaturesSetting:\n"));\r
DumpCpuFeatureMask (CpuFeaturesData->SettingPcd);\r
);\r
\r
+ //\r
+ // Save PCDs and display CPU PCDs\r
+ //\r
+ SetCapabilityPcd (CpuFeaturesData->CapabilityPcd, CpuFeaturesData->BitMaskSize);\r
+ SetSettingPcd (CpuFeaturesData->SettingPcd);\r
+\r
for (ProcessorNumber = 0; ProcessorNumber < NumberOfCpus; ProcessorNumber++) {\r
CpuInitOrder = &CpuFeaturesData->InitOrder[ProcessorNumber];\r
Entry = GetFirstNode (&CpuFeaturesData->FeatureList);\r
## @file\r
# Register CPU Features Library DXE instance.\r
#\r
-# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
[Pcd]\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress ## CONSUMES\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport ## CONSUMES\r
- gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration ## CONSUMES\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability ## PRODUCES\r
- gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting ## PRODUCES\r
+ gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting ## PRODUCES ## CONSUMES\r
\r
[Depex]\r
gEfiMpServiceProtocolGuid AND gEdkiiCpuFeaturesSetDoneGuid\r
## @file\r
# Register CPU Features Library PEI instance.\r
#\r
-# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
[Pcd]\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress ## CONSUMES\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport ## CONSUMES\r
- gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration ## CONSUMES\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability ## PRODUCES\r
- gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting ## PRODUCES\r
+ gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting ## CONSUMES ## PRODUCES\r
\r
[Depex]\r
gEfiPeiMpServicesPpiGuid AND gEdkiiCpuFeaturesSetDoneGuid\r
# @Prompt SMM CPU Synchronization Method.\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x00|UINT8|0x60000014\r
\r
- ## Specifies user's desired settings for enabling/disabling processor features.\r
- # @Prompt User settings for enabling/disabling processor features.\r
- gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000017\r
-\r
## Specifies the On-demand clock modulation duty cycle when ACPI feature is enabled.\r
# @Prompt The encoded values for target duty cycle modulation.\r
# @ValidRange 0x80000001 | 0 - 15\r
# @ValidList 0x80000001 | 0\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000018\r
\r
- ## Specifies actual settings for processor features, each bit corresponding to a specific feature.\r
- # @Prompt Actual processor feature settings.\r
+ ## As input, specifies user's desired settings for enabling/disabling processor features.\r
+ ## As output, specifies actual settings for processor features, each bit corresponding to a specific feature.\r
+ # @Prompt As input, specifies user's desired processor feature settings. As output, specifies actual processor feature settings.\r
# @ValidList 0x80000001 | 0\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000019\r
\r