summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-07-21 21:28:16 +0800
committerJeff Fan <jeff.fan@intel.com>2016-08-17 20:02:22 +0800
commit08085f08ecfb6a98ec8b70a75a48cfbe4220531e (patch)
tree4e173a6dc5b9888996d4a5ed662fa65caad1b561 /UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
parente37109bcc75b3242fccb223979f954c162ee103f (diff)
downloadedk2-08085f08ecfb6a98ec8b70a75a48cfbe4220531e.tar.gz
edk2-08085f08ecfb6a98ec8b70a75a48cfbe4220531e.tar.bz2
edk2-08085f08ecfb6a98ec8b70a75a48cfbe4220531e.zip
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>
Diffstat (limited to 'UefiCpuPkg/Library/MpInitLib/DxeMpLib.c')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/DxeMpLib.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index 988920fc07..bd132404cc 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -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;
+ }
+ }
}
/**