EFI_EVENT mCheckAllApsEvent = NULL;\r
EFI_EVENT mMpInitExitBootServicesEvent = NULL;\r
volatile BOOLEAN mStopCheckAllApsStatus = TRUE;\r
-\r
+VOID *mReservedApLoopFunc = NULL;\r
\r
/**\r
Get the pointer to CPU MP Data structure.\r
)\r
{\r
CPU_MP_DATA *CpuMpData;\r
- VOID *ReservedApLoopFunc;\r
- //\r
- // Avoid APs access invalid buff data which allocated by BootServices,\r
- // so we will allocate reserved data for AP loop code.\r
- //\r
+\r
CpuMpData = GetCpuMpData ();\r
CpuMpData->PmCodeSegment = GetProtectedModeCS ();\r
CpuMpData->ApLoopMode = PcdGet8 (PcdCpuApLoopMode);\r
- ReservedApLoopFunc = AllocateReservedCopyPool (\r
- CpuMpData->AddressMap.RelocateApLoopFuncSize,\r
- CpuMpData->AddressMap.RelocateApLoopFuncAddress\r
- );\r
- WakeUpAP (CpuMpData, TRUE, 0, RelocateApLoop, ReservedApLoopFunc);\r
+ WakeUpAP (CpuMpData, TRUE, 0, RelocateApLoop, mReservedApLoopFunc);\r
DEBUG ((DEBUG_INFO, "MpInitExitBootServicesCallback() done!\n"));\r
}\r
\r
\r
SaveCpuMpData (CpuMpData);\r
\r
+ //\r
+ // Avoid APs access invalid buff data which allocated by BootServices,\r
+ // so we will allocate reserved data for AP loop code.\r
+ // Allocating it in advance since memory services are not available in\r
+ // Exit Boot Services callback function.\r
+ //\r
+ mReservedApLoopFunc = AllocateReservedCopyPool (\r
+ CpuMpData->AddressMap.RelocateApLoopFuncSize,\r
+ CpuMpData->AddressMap.RelocateApLoopFuncAddress\r
+ );\r
+ ASSERT (mReservedApLoopFunc != NULL);\r
+\r
Status = gBS->CreateEvent (\r
EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
TPL_NOTIFY,\r