mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg: Refactor the logic for placing APs in HltLoop.
Refactor the logic for placing APs in HltLoop into a separate function. Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
This commit is contained in:
parent
63923a5642
commit
88f436883b
|
@ -636,6 +636,28 @@ InitializeApData (
|
||||||
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
|
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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.
|
This function will be called from AP reset code if BSP uses WakeUpAP.
|
||||||
|
|
||||||
|
@ -812,19 +834,10 @@ ApWakeupFunction (
|
||||||
// Place AP is specified loop mode
|
// Place AP is specified loop mode
|
||||||
//
|
//
|
||||||
if (CpuMpData->ApLoopMode == ApInHltLoop) {
|
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) {
|
while (TRUE) {
|
||||||
|
|
Loading…
Reference in New Issue