/** Callback function for ExitBootServices. @param[in] Event Event whose notification function is being invoked. @param[in] Context The pointer to the notification function's context, which is implementation-dependent. **/ VOID EFIAPI MpInitChangeApLoopCallback ( IN EFI_EVENT Event, IN VOID *Context ) { CPU_MP_DATA *CpuMpData; CpuMpData = GetCpuMpData (); CpuMpData->PmCodeSegment = GetProtectedModeCS (); CpuMpData->ApLoopMode = PcdGet8 (PcdCpuApLoopMode); mNumberToFinish = CpuMpData->CpuCount - 1; WakeUpAP (CpuMpData, TRUE, 0, RelocateApLoop, NULL, TRUE); while (mNumberToFinish > 0) { CpuPause (); } DEBUG ((DEBUG_INFO, "%a() done!\n", __FUNCTION__)); }
/** Transfer AP to safe hlt-loop after it finished restore CPU features on S3 patch. @param[in] ApHltLoopCode The address of the safe hlt-loop function. @param[in] TopOfStack A pointer to the new stack to use for the ApHltLoopCode. @param[in] NumberToFinishAddress Address of Semaphore of APs finish count. **/ VOID TransferApToSafeState ( IN UINTN ApHltLoopCode, IN UINTN TopOfStack, IN UINTN NumberToFinishAddress ) { AsmDisablePaging64 ( GetProtectedModeCS (), (UINT32)ApHltLoopCode, (UINT32)NumberToFinishAddress, 0, (UINT32)TopOfStack ); // // It should never reach here // ASSERT (FALSE); }