summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
diff options
context:
space:
mode:
authorWei6 Xu <wei6.xu@intel.com>2024-05-14 10:20:06 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-28 15:25:27 +0000
commitb7931cafea0052b4f3be66dc4f83ae63db4600c5 (patch)
treefab0e910456ffb882dda1bde89935ea41e5e43ad /StandaloneMmPkg
parentc8df60801fa20e3e1dc85acdf37d73ca5cca8206 (diff)
downloadedk2-b7931cafea0052b4f3be66dc4f83ae63db4600c5.tar.gz
StandaloneMmPkg/Core: Install protocol to notify MmEndOfPei event
When the EndOfPei event is signaled, installs the MM EndOfPei Protocol so MM Drivers are informed that EndOfPei event is signaled. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Diffstat (limited to 'StandaloneMmPkg')
-rw-r--r--StandaloneMmPkg/Core/StandaloneMmCore.c41
-rw-r--r--StandaloneMmPkg/Core/StandaloneMmCore.h23
-rw-r--r--StandaloneMmPkg/Core/StandaloneMmCore.inf1
3 files changed, 65 insertions, 0 deletions
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core/StandaloneMmCore.c
index c1281ca8d4..352a067253 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.c
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
@@ -76,6 +76,7 @@ EFI_MM_SYSTEM_TABLE gMmCoreMmst = {
MM_CORE_MMI_HANDLERS mMmCoreMmiHandlers[] = {
{ MmDriverDispatchHandler, &gEventMmDispatchGuid, NULL, FALSE },
{ MmReadyToLockHandler, &gEfiDxeMmReadyToLockProtocolGuid, NULL, TRUE },
+ { MmEndOfPeiHandler, &gEfiMmEndOfPeiProtocol, NULL, FALSE },
{ MmEndOfDxeHandler, &gEfiEndOfDxeEventGroupGuid, NULL, FALSE },
{ MmExitBootServiceHandler, &gEfiEventExitBootServicesGuid, NULL, FALSE },
{ MmReadyToBootHandler, &gEfiEventReadyToBootGuid, NULL, FALSE },
@@ -275,6 +276,46 @@ MmReadyToLockHandler (
}
/**
+ Software MMI handler that is called when the EndOfPei event is signaled.
+ This function installs the MM EndOfPei Protocol so MM Drivers are informed that
+ EndOfPei event is signaled.
+
+ @param DispatchHandle The unique handle assigned to this handler by MmiHandlerRegister().
+ @param Context Points to an optional handler context which was specified when the handler was registered.
+ @param CommBuffer A pointer to a collection of data in memory that will
+ be conveyed from a non-MM environment into an MM environment.
+ @param CommBufferSize The size of the CommBuffer.
+
+ @return Status Code
+
+**/
+EFI_STATUS
+EFIAPI
+MmEndOfPeiHandler (
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
+ )
+{
+ EFI_STATUS Status;
+ EFI_HANDLE MmHandle;
+
+ DEBUG ((DEBUG_INFO, "MmEndOfPeiHandler\n"));
+ //
+ // Install MM EndOfDxe protocol
+ //
+ MmHandle = NULL;
+ Status = MmInstallProtocolInterface (
+ &MmHandle,
+ &gEfiMmEndOfPeiProtocol,
+ EFI_NATIVE_INTERFACE,
+ NULL
+ );
+ return Status;
+}
+
+/**
Software MMI handler that is called when the EndOfDxe event is signaled.
This function installs the MM EndOfDxe Protocol so MM Drivers are informed that
platform code will invoke 3rd part code.
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h
index 681b7ff61d..632ded9b27 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.h
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.h
@@ -684,6 +684,29 @@ MmReadyToLockHandler (
);
/**
+ Software MMI handler that is called when the EndOfPei event is signaled.
+ This function installs the MM EndOfPei Protocol so MM Drivers are informed that
+ EndOfPei event is signaled.
+
+ @param DispatchHandle The unique handle assigned to this handler by MmiHandlerRegister().
+ @param Context Points to an optional handler context which was specified when the handler was registered.
+ @param CommBuffer A pointer to a collection of data in memory that will
+ be conveyed from a non-MM environment into an MM environment.
+ @param CommBufferSize The size of the CommBuffer.
+
+ @return Status Code
+
+**/
+EFI_STATUS
+EFIAPI
+MmEndOfPeiHandler (
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
+ );
+
+/**
This function is the main entry point for an MM handler dispatch
or communicate-based callback.
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index a6fafa5690..58c3bdee03 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -60,6 +60,7 @@
gEfiMmEndOfDxeProtocolGuid ## PRODUCES
gEfiLoadedImageProtocolGuid ## PRODUCES
gEfiMmConfigurationProtocolGuid ## CONSUMES
+ gEfiMmEndOfPeiProtocol ## PRODUCES
[Guids]
gAprioriGuid ## SOMETIMES_CONSUMES ## File