UefiCpuPkg/MpInitLib: Check APs Status and update APs status
v3: 1. Use CamelCase for CheckAndUpdateApsStatus(). Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
This commit is contained in:
@ -120,6 +120,43 @@ CheckAndUpdateApsStatus (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINTN ProcessorNumber;
|
||||
EFI_STATUS Status;
|
||||
CPU_MP_DATA *CpuMpData;
|
||||
|
||||
CpuMpData = GetCpuMpData ();
|
||||
|
||||
//
|
||||
// First, check whether pending StartupAllAPs() exists.
|
||||
//
|
||||
if (CpuMpData->WaitEvent != NULL) {
|
||||
|
||||
Status = CheckAllAPs ();
|
||||
//
|
||||
// If all APs finish for StartupAllAPs(), signal the WaitEvent for it.
|
||||
//
|
||||
if (Status != EFI_NOT_READY) {
|
||||
Status = gBS->SignalEvent (CpuMpData->WaitEvent);
|
||||
CpuMpData->WaitEvent = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Second, check whether pending StartupThisAPs() callings exist.
|
||||
//
|
||||
for (ProcessorNumber = 0; ProcessorNumber < CpuMpData->CpuCount; ProcessorNumber++) {
|
||||
|
||||
if (CpuMpData->CpuData[ProcessorNumber].WaitEvent == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Status = CheckThisAP (ProcessorNumber);
|
||||
|
||||
if (Status != EFI_NOT_READY) {
|
||||
gBS->SignalEvent (CpuMpData->CpuData[ProcessorNumber].WaitEvent);
|
||||
CpuMpData->CpuData[ProcessorNumber].WaitEvent = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user