diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuStandaloneMm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuStandaloneMm.c index ed5466a74d..7d143e78eb 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuStandaloneMm.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuStandaloneMm.c @@ -135,3 +135,49 @@ GetMpInformationFromMpServices ( return NULL; } + +/** + The module Entry Point of the CPU StandaloneMm driver. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the MM System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval Other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +PiCpuStandaloneMmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status = PiSmmCpuEntryCommon (); + + ASSERT_EFI_ERROR (Status); + + if (FeaturePcdGet (PcdCpuSmmProfileEnable)) { + // + // Get Software SMI + // + GetSmiCommandPort (); + } + + // + // Install the SMM Configuration Protocol onto a new handle on the handle database. + // The entire SMM Configuration Protocol is allocated from SMRAM, so only a pointer + // to an SMRAM address will be present in the handle database + // + Status = gMmst->MmInstallProtocolInterface ( + &gSmmCpuPrivate->SmmCpuHandle, + &gEfiSmmConfigurationProtocolGuid, + EFI_NATIVE_INTERFACE, + &gSmmCpuPrivate->SmmConfiguration + ); + ASSERT_EFI_ERROR (Status); + + return Status; +}