diff options
author | Michael Kinney <michael.d.kinney@intel.com> | 2015-11-17 04:50:47 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-11-17 04:50:47 +0000 |
commit | fd499fabd32969c702dde04b37fe782871c6ffce (patch) | |
tree | 0120c145f494561545f337b75270e0d39859f9c4 /UefiCpuPkg/CpuMpPei/CpuMpPei.c | |
parent | aa498e38bf2f7e86b695587a3487bca830b9bbde (diff) | |
download | edk2-platforms-fd499fabd32969c702dde04b37fe782871c6ffce.tar.xz |
UefiCpuPkg: Update CPU MP drivers to support single CPU configuration
Only perform AP detection if PcdCpuMaxLogicalProcessorNumber > 1
Only free AP related structures of they were allocated
(Sync patch r18629 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18824 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/CpuMpPei/CpuMpPei.c')
-rw-r--r-- | UefiCpuPkg/CpuMpPei/CpuMpPei.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index d5bc0c9b80..8e35f288fe 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -357,22 +357,28 @@ CountProcessorNumber ( // Store BSP's MTRR setting
//
MtrrGetAllMtrrs (&PeiCpuMpData->MtrrTable);
+
//
- // Send broadcast IPI to APs to wakeup APs
- //
- PeiCpuMpData->InitFlag = 1;
- WakeUpAP (PeiCpuMpData, TRUE, 0, NULL, NULL);
- //
- // Wait for AP task to complete and then exit.
- //
- MicroSecondDelay (PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds));
- PeiCpuMpData->InitFlag = 0;
- PeiCpuMpData->CpuCount += (UINT32) PeiCpuMpData->MpCpuExchangeInfo->NumApsExecuting;
- ASSERT (PeiCpuMpData->CpuCount <= PcdGet32(PcdCpuMaxLogicalProcessorNumber));
- //
- // Sort BSP/Aps by CPU APIC ID in ascending order
+ // Only perform AP detection if PcdCpuMaxLogicalProcessorNumber is greater than 1
//
- SortApicId (PeiCpuMpData);
+ if (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 1) {
+ //
+ // Send broadcast IPI to APs to wakeup APs
+ //
+ PeiCpuMpData->InitFlag = 1;
+ WakeUpAP (PeiCpuMpData, TRUE, 0, NULL, NULL);
+ //
+ // Wait for AP task to complete and then exit.
+ //
+ MicroSecondDelay (PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds));
+ PeiCpuMpData->InitFlag = 0;
+ PeiCpuMpData->CpuCount += (UINT32)PeiCpuMpData->MpCpuExchangeInfo->NumApsExecuting;
+ ASSERT (PeiCpuMpData->CpuCount <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
+ //
+ // Sort BSP/Aps by CPU APIC ID in ascending order
+ //
+ SortApicId (PeiCpuMpData);
+ }
DEBUG ((EFI_D_INFO, "CpuMpPei: Find %d processors in system.\n", PeiCpuMpData->CpuCount));
return PeiCpuMpData->CpuCount;
|