summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index f1f2840714..9560b39220 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -637,6 +637,28 @@ InitializeApData (
}
/**
+ This function place APs in Halt loop.
+
+ @param[in] CpuMpData Pointer to CPU MP Data
+**/
+VOID
+PlaceAPInHltLoop (
+ IN CPU_MP_DATA *CpuMpData
+ )
+{
+ while (TRUE) {
+ DisableInterrupts ();
+ if (CpuMpData->UseSevEsAPMethod) {
+ SevEsPlaceApHlt (CpuMpData);
+ } else {
+ CpuSleep ();
+ }
+
+ CpuPause ();
+ }
+}
+
+/**
This function will be called from AP reset code if BSP uses WakeUpAP.
@param[in] ExchangeInfo Pointer to the MP exchange info buffer
@@ -812,19 +834,10 @@ ApWakeupFunction (
// Place AP is specified loop mode
//
if (CpuMpData->ApLoopMode == ApInHltLoop) {
+ PlaceAPInHltLoop (CpuMpData);
//
- // Place AP in HLT-loop
+ // Never run here
//
- while (TRUE) {
- DisableInterrupts ();
- if (CpuMpData->UseSevEsAPMethod) {
- SevEsPlaceApHlt (CpuMpData);
- } else {
- CpuSleep ();
- }
-
- CpuPause ();
- }
}
while (TRUE) {