diff options
author | Chen Fan <chen.fan.fnst@cn.fujitsu.com> | 2014-11-13 18:29:31 +0000 |
---|---|---|
committer | jljusten <jljusten@Edk2> | 2014-11-13 18:29:31 +0000 |
commit | 232eb4c82637e92b65ebbfc89a45e9daa8535171 (patch) | |
tree | e80b1b5d989caf7ccf7de82c8fb3ef169f4d4ac6 /UefiCpuPkg | |
parent | ac9dbb3b03313c7426c5bb15663b20b57ca771ce (diff) | |
download | edk2-232eb4c82637e92b65ebbfc89a45e9daa8535171.tar.gz edk2-232eb4c82637e92b65ebbfc89a45e9daa8535171.tar.bz2 edk2-232eb4c82637e92b65ebbfc89a45e9daa8535171.zip |
UefiCpuPkg/MpService: free the unused cpu data buffer
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16367 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/CpuDxe/CpuMp.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 13fcda5859..10065762a2 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -25,7 +25,7 @@ VOID *mCommonStack = 0; VOID *mTopOfApCommonStack = 0;
VOID *mApStackStart = 0;
-BOOLEAN mAPsAlreadyInitFinished = FALSE;
+volatile BOOLEAN mAPsAlreadyInitFinished = FALSE;
volatile BOOLEAN mStopCheckAllAPsStatus = TRUE;
EFI_MP_SERVICES_PROTOCOL mMpServicesTemplate = {
@@ -1135,11 +1135,15 @@ ProcessorToIdleState ( EFI_AP_PROCEDURE Procedure;
VOID *ProcedureArgument;
+ AsmApDoneWithCommonStack ();
+
+ while (!mAPsAlreadyInitFinished) {
+ CpuPause ();
+ }
+
WhoAmI (&mMpServicesTemplate, &ProcessorNumber);
CpuData = &mMpSystemData.CpuDatas[ProcessorNumber];
- AsmApDoneWithCommonStack ();
-
//
// Avoid forcibly reset AP caused the AP State is not updated.
//
@@ -1486,6 +1490,11 @@ InitializeMpSupport ( return;
}
+ mMpSystemData.CpuDatas = ReallocatePool (
+ sizeof (CPU_DATA_BLOCK) * gMaxLogicalProcessorNumber,
+ sizeof (CPU_DATA_BLOCK) * mMpSystemData.NumberOfProcessors,
+ mMpSystemData.CpuDatas);
+
mAPsAlreadyInitFinished = TRUE;
if (mMpSystemData.NumberOfProcessors < gMaxLogicalProcessorNumber) {
|