X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FLibrary%2FMpInitLib%2FPeiMpLib.c;h=fb1d48fad848f6d3d36fef81e97e93cc55c1a01a;hb=ffab244280fd934c9a02142765e40f70fbc061a1;hp=4ea8fa96a191a4ccd19d263ab5d13806334602b3;hpb=20ae57745b19538229ba0670c10e08c13f9e2574;p=mirror_edk2.git diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c index 4ea8fa96a1..fb1d48fad8 100644 --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c @@ -25,6 +25,18 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR mMpInitLibNotifyList = { CpuMpEndOfPeiCallback }; + +/** + Enable Debug Agent to support source debugging on AP function. + +**/ +VOID +EnableDebugAgent ( + VOID + ) +{ +} + /** Get pointer to CPU MP Data structure. @@ -64,45 +76,6 @@ SaveCpuMpData ( ); } -/** - Get available system memory below 1MB by specified size. - - @param[in] PeiCpuMpData Pointer to PEI CPU MP Data -**/ -VOID -BackupAndPrepareWakeupBuffer( - IN CPU_MP_DATA *CpuMpData - ) -{ - CopyMem ( - (VOID *) CpuMpData->BackupBuffer, - (VOID *) CpuMpData->WakeupBuffer, - CpuMpData->BackupBufferSize - ); - CopyMem ( - (VOID *) CpuMpData->WakeupBuffer, - (VOID *) CpuMpData->AddressMap.RendezvousFunnelAddress, - CpuMpData->AddressMap.RendezvousFunnelSize - ); -} - -/** - Restore wakeup buffer data. - - @param[in] PeiCpuMpData Pointer to PEI CPU MP Data -**/ -VOID -RestoreWakeupBuffer( - IN CPU_MP_DATA *CpuMpData - ) -{ - CopyMem ( - (VOID *) CpuMpData->WakeupBuffer, - (VOID *) CpuMpData->BackupBuffer, - CpuMpData->BackupBufferSize - ); -} - /** Notify function on End Of PEI PPI. @@ -157,7 +130,7 @@ CpuMpEndOfPeiCallback ( Hob.Raw = GET_NEXT_HOB (Hob); } } else { - CpuMpData->EndOfPeiFlag = TRUE; + CpuMpData->SaveRestoreFlag = TRUE; RestoreWakeupBuffer (CpuMpData); } return EFI_SUCCESS; @@ -316,7 +289,7 @@ AllocateResetVector ( BackupAndPrepareWakeupBuffer (CpuMpData); } - if (CpuMpData->EndOfPeiFlag) { + if (CpuMpData->SaveRestoreFlag) { BackupAndPrepareWakeupBuffer (CpuMpData); } } @@ -331,7 +304,7 @@ FreeResetVector ( IN CPU_MP_DATA *CpuMpData ) { - if (CpuMpData->EndOfPeiFlag) { + if (CpuMpData->SaveRestoreFlag) { RestoreWakeupBuffer (CpuMpData); } } @@ -360,6 +333,14 @@ InitMpGlobalData ( EFI_STATUS Status; SaveCpuMpData (CpuMpData); + + if (CpuMpData->CpuCount == 1) { + // + // If only BSP exists, return + // + return; + } + // // Register an event for EndOfPei // @@ -394,7 +375,7 @@ InitMpGlobalData ( EFI_EVENT is defined in CreateEvent() in the Unified Extensible Firmware Interface Specification. - @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for + @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for APs to return from Procedure, either for blocking or non-blocking mode. Zero means infinity. If the timeout expires before @@ -453,7 +434,18 @@ MpInitLibStartupAllAPs ( OUT UINTN **FailedCpuList OPTIONAL ) { - return EFI_UNSUPPORTED; + if (WaitEvent != NULL) { + return EFI_UNSUPPORTED; + } + + return StartupAllAPsWorker ( + Procedure, + SingleThread, + NULL, + TimeoutInMicroseconds, + ProcedureArgument, + FailedCpuList + ); } /** @@ -483,7 +475,7 @@ MpInitLibStartupAllAPs ( EFI_EVENT is defined in CreateEvent() in the Unified Extensible Firmware Interface Specification. - @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for + @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for this AP to finish this Procedure, either for blocking or non-blocking mode. Zero means infinity. If the timeout expires before