]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei: Exchange whole CPU data in SortApicId()
authorJeff Fan <jeff.fan@intel.com>
Wed, 2 Dec 2015 00:42:09 +0000 (00:42 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 2 Dec 2015 00:42:09 +0000 (00:42 +0000)
Current implementation only exchanges the APIC ID and BIST, this updating is to
exchange all CPU data.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19085 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuMpPei/CpuMpPei.c

index c222522203164f5a5a27f21641057e4fef76fd07..ae071ac1f81abaab4d8d8c9342821412df4aeb9d 100644 (file)
@@ -61,7 +61,7 @@ SortApicId (
   UINTN             Index2;\r
   UINTN             Index3;\r
   UINT32            ApicId;\r
-  EFI_HEALTH_FLAGS  Health;\r
+  PEI_CPU_DATA      CpuData;\r
   UINT32            ApCount;\r
 \r
   ApCount = PeiCpuMpData->CpuCount - 1;\r
@@ -80,11 +80,13 @@ SortApicId (
         }\r
       }\r
       if (Index3 != Index1) {\r
-        PeiCpuMpData->CpuData[Index3].ApicId = PeiCpuMpData->CpuData[Index1].ApicId;\r
-        PeiCpuMpData->CpuData[Index1].ApicId = ApicId;\r
-        Health = PeiCpuMpData->CpuData[Index3].Health;\r
-        PeiCpuMpData->CpuData[Index3].Health = PeiCpuMpData->CpuData[Index1].Health;\r
-        PeiCpuMpData->CpuData[Index1].Health = Health;\r
+        CopyMem (&CpuData, &PeiCpuMpData->CpuData[Index3], sizeof (PEI_CPU_DATA));\r
+        CopyMem (\r
+          &PeiCpuMpData->CpuData[Index3],\r
+          &PeiCpuMpData->CpuData[Index1],\r
+          sizeof (PEI_CPU_DATA)\r
+          );\r
+        CopyMem (&PeiCpuMpData->CpuData[Index1], &CpuData, sizeof (PEI_CPU_DATA));\r
       }\r
     }\r
 \r