mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
StandaloneMmPkg/MmIpl: Install end of PEI notify PPI
Install end of PEI notify PPI for issue gEfiMmEndOfPeiProtocol Handler in MM Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
This commit is contained in:
parent
e98eca076a
commit
3ac296def1
@ -16,6 +16,12 @@ EFI_PEI_PPI_DESCRIPTOR mPpiList = {
|
|||||||
&mMmCommunicationPpi
|
&mMmCommunicationPpi
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList = {
|
||||||
|
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
|
||||||
|
&gEfiEndOfPeiSignalPpiGuid,
|
||||||
|
EndOfPeiCallback
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Communicates with a registered handler.
|
Communicates with a registered handler.
|
||||||
|
|
||||||
@ -451,6 +457,47 @@ ExecuteMmCoreFromMmram (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
This is the callback function on end of PEI.
|
||||||
|
|
||||||
|
This callback is used for call MmEndOfPeiHandler in standalone MM core.
|
||||||
|
|
||||||
|
@param PeiServices General purpose services available to every PEIM.
|
||||||
|
@param NotifyDescriptor The notification structure this PEIM registered on install.
|
||||||
|
@param Ppi Pointer to the PPI data associated with this function.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Exit boot services successfully.
|
||||||
|
@retval Other Exit boot services failed.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
EndOfPeiCallback (
|
||||||
|
IN EFI_PEI_SERVICES **PeiServices,
|
||||||
|
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
|
||||||
|
IN VOID *Ppi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_MM_COMMUNICATE_HEADER CommunicateHeader;
|
||||||
|
UINTN Size;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Use Guid to initialize EFI_MM_COMMUNICATE_HEADER structure
|
||||||
|
//
|
||||||
|
CopyGuid (&CommunicateHeader.HeaderGuid, &gEfiMmEndOfPeiProtocol);
|
||||||
|
CommunicateHeader.MessageLength = 1;
|
||||||
|
CommunicateHeader.Data[0] = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Generate the Software SMI and return the result
|
||||||
|
//
|
||||||
|
Size = sizeof (CommunicateHeader);
|
||||||
|
Status = Communicate (NULL, &CommunicateHeader, &Size);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Build communication buffer HOB.
|
Build communication buffer HOB.
|
||||||
|
|
||||||
@ -550,5 +597,11 @@ StandaloneMmIplPeiEntry (
|
|||||||
Status = PeiServicesInstallPpi (&mPpiList);
|
Status = PeiServicesInstallPpi (&mPpiList);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create end of pei callback to call MmEndOfPeiHandler
|
||||||
|
//
|
||||||
|
Status = PeiServicesNotifyPpi (&mNotifyList);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -47,4 +47,23 @@ Communicate (
|
|||||||
IN OUT UINTN *CommSize
|
IN OUT UINTN *CommSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
This is the callback function on end of PEI.
|
||||||
|
|
||||||
|
This callback is used for call MmEndOfPeiHandler in standalone MM core.
|
||||||
|
|
||||||
|
@param PeiServices General purpose services available to every PEIM.
|
||||||
|
@param NotifyDescriptor The notification structure this PEIM registered on install.
|
||||||
|
@param Ppi Pointer to the PPI data associated with this function.
|
||||||
|
@retval EFI_SUCCESS Exit boot services successfully.
|
||||||
|
@retval Other Exit boot services failed.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
EndOfPeiCallback (
|
||||||
|
IN EFI_PEI_SERVICES **PeiServices,
|
||||||
|
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
|
||||||
|
IN VOID *Ppi
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -49,6 +49,10 @@
|
|||||||
[Ppis]
|
[Ppis]
|
||||||
gEfiPeiMmControlPpiGuid
|
gEfiPeiMmControlPpiGuid
|
||||||
gEfiPeiMmCommunicationPpiGuid
|
gEfiPeiMmCommunicationPpiGuid
|
||||||
|
gEfiEndOfPeiSignalPpiGuid
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
gEfiMmEndOfPeiProtocol
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user