]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg MpInitLib: Fix typo "sCPUID" to "CPUID"
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / Microcode.c
index 5bb0145c87f04fe103a85be761d135e37dbc036d..e47f9f4f8f349b2fbc94c1a1f138c19be1653a40 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of loading microcode on processors.\r
 \r
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2018, 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
@@ -35,15 +35,13 @@ GetCurrentMicrocodeSignature (
 /**\r
   Detect whether specified processor can find matching microcode patch and load it.\r
 \r
-  @param[in] PeiCpuMpData        Pointer to PEI CPU MP Data\r
+  @param[in]  CpuMpData  The pointer to CPU MP Data structure.\r
 **/\r
 VOID\r
 MicrocodeDetect (\r
   IN CPU_MP_DATA             *CpuMpData\r
   )\r
 {\r
-  UINT64                                  MicrocodePatchAddress;\r
-  UINT64                                  MicrocodePatchRegionSize;\r
   UINT32                                  ExtendedTableLength;\r
   UINT32                                  ExtendedTableCount;\r
   CPU_MICROCODE_EXTENDED_TABLE            *ExtendedTable;\r
@@ -61,9 +59,7 @@ MicrocodeDetect (
   VOID                                    *MicrocodeData;\r
   MSR_IA32_PLATFORM_ID_REGISTER           PlatformIdMsr;\r
 \r
-  MicrocodePatchAddress    = PcdGet64 (PcdCpuMicrocodePatchAddress);\r
-  MicrocodePatchRegionSize = PcdGet64 (PcdCpuMicrocodePatchRegionSize);\r
-  if (MicrocodePatchRegionSize == 0) {\r
+  if (CpuMpData->MicrocodePatchRegionSize == 0) {\r
     //\r
     // There is no microcode patches\r
     //\r
@@ -81,7 +77,7 @@ MicrocodeDetect (
   ExtendedTableLength = 0;\r
   //\r
   // Here data of CPUID leafs have not been collected into context buffer, so\r
-  // GetProcessorCpuid() cannot be used here to retrieve sCPUID data.\r
+  // GetProcessorCpuid() cannot be used here to retrieve CPUID data.\r
   //\r
   AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, NULL, NULL, NULL);\r
 \r
@@ -93,8 +89,8 @@ MicrocodeDetect (
 \r
   LatestRevision = 0;\r
   MicrocodeData  = NULL;\r
-  MicrocodeEnd = (UINTN) (MicrocodePatchAddress + MicrocodePatchRegionSize);\r
-  MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) MicrocodePatchAddress;\r
+  MicrocodeEnd = (UINTN) (CpuMpData->MicrocodePatchAddress + CpuMpData->MicrocodePatchRegionSize);\r
+  MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) CpuMpData->MicrocodePatchAddress;\r
   do {\r
     //\r
     // Check if the microcode is for the Cpu and the version is newer\r