UefiCpuPkg/CpuMpPei: Exchange whole CPU data in SortApicId()

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
This commit is contained in:
Jeff Fan 2015-12-02 00:42:09 +00:00 committed by vanjeff
parent ce6aec3ea3
commit 24930b5609
1 changed files with 8 additions and 6 deletions

View File

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