UefiCpuPkg/CpuMpPei: Register callback on End Of Pei PPI

Add CpuMpEndOfPeiCallback () to restore wakeup buffer data on S3 path and flag
flag wakeup buffer to be un-used type on normal boot path. Set one EndOfPei
flag save/restore wakeup buffer when wakeup APs every time.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18014 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jeff Fan
2015-07-15 03:46:13 +00:00
committed by vanjeff
parent fcc82734bf
commit 8f7b315b1c
4 changed files with 177 additions and 0 deletions

View File

@@ -480,6 +480,13 @@ PeiStartupAllAPs (
return EFI_NOT_READY;
}
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Backup original data and copy AP reset vector in it
//
BackupAndPrepareWakeupBuffer(PeiCpuMpData);
}
WaitCountNumber = TimeoutInMicroSeconds / CPU_CHECK_AP_INTERVAL + 1;
WaitCountIndex = 0;
FinishedCount = &PeiCpuMpData->FinishedCount;
@@ -531,6 +538,13 @@ PeiStartupAllAPs (
}
}
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Restore original data
//
RestoreWakeupBuffer(PeiCpuMpData);
}
return Status;
}
@@ -626,6 +640,13 @@ PeiStartupThisAP (
return EFI_INVALID_PARAMETER;
}
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Backup original data and copy AP reset vector in it
//
BackupAndPrepareWakeupBuffer(PeiCpuMpData);
}
WaitCountNumber = TimeoutInMicroseconds / CPU_CHECK_AP_INTERVAL + 1;
WaitCountIndex = 0;
FinishedCount = &PeiCpuMpData->FinishedCount;
@@ -651,6 +672,13 @@ PeiStartupThisAP (
}
}
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Backup original data and copy AP reset vector in it
//
RestoreWakeupBuffer(PeiCpuMpData);
}
return Status;
}
@@ -749,6 +777,13 @@ PeiSwitchBSP (
PeiCpuMpData->BSPInfo.State = CPU_SWITCH_STATE_IDLE;
PeiCpuMpData->APInfo.State = CPU_SWITCH_STATE_IDLE;
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Backup original data and copy AP reset vector in it
//
BackupAndPrepareWakeupBuffer(PeiCpuMpData);
}
//
// Need to wakeUp AP (future BSP).
//
@@ -756,6 +791,13 @@ PeiSwitchBSP (
AsmExchangeRole (&PeiCpuMpData->BSPInfo, &PeiCpuMpData->APInfo);
if (PeiCpuMpData->EndOfPeiFlag) {
//
// Backup original data and copy AP reset vector in it
//
RestoreWakeupBuffer(PeiCpuMpData);
}
//
// Set the BSP bit of MSR_IA32_APIC_BASE on new BSP
//