mirror of https://github.com/acidanthera/audk.git
ArmPkg/MmCommunicationDxe: relay architected PI events to MM context
PI defines a few architected events that have significance in the MM context as well as in the non-secure DXE context. So register notify handlers for these events, and relay them into the standalone MM world. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
This commit is contained in:
parent
d3add11e87
commit
2fe25a74d6
|
@ -259,6 +259,43 @@ GetMmCompatibility ()
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC EFI_GUID* CONST mGuidedEventGuid[] = {
|
||||||
|
&gEfiEndOfDxeEventGroupGuid,
|
||||||
|
&gEfiEventExitBootServicesGuid,
|
||||||
|
&gEfiEventReadyToBootGuid,
|
||||||
|
};
|
||||||
|
|
||||||
|
STATIC EFI_EVENT mGuidedEvent[ARRAY_SIZE (mGuidedEventGuid)];
|
||||||
|
|
||||||
|
/**
|
||||||
|
Event notification that is fired when GUIDed Event Group is signaled.
|
||||||
|
|
||||||
|
@param Event The Event that is being processed, not used.
|
||||||
|
@param Context Event Context, not used.
|
||||||
|
|
||||||
|
**/
|
||||||
|
STATIC
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
MmGuidedEventNotify (
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
IN VOID *Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_MM_COMMUNICATE_HEADER Header;
|
||||||
|
UINTN Size;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure
|
||||||
|
//
|
||||||
|
CopyGuid (&Header.HeaderGuid, Context);
|
||||||
|
Header.MessageLength = 1;
|
||||||
|
Header.Data[0] = 0;
|
||||||
|
|
||||||
|
Size = sizeof (Header);
|
||||||
|
MmCommunicationCommunicate (&mMmCommunication, &Header, &Size);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The Entry Point for MM Communication
|
The Entry Point for MM Communication
|
||||||
|
|
||||||
|
@ -281,6 +318,7 @@ MmCommunicationInitialize (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
UINTN Index;
|
||||||
|
|
||||||
// Check if we can make the MM call
|
// Check if we can make the MM call
|
||||||
Status = GetMmCompatibility ();
|
Status = GetMmCompatibility ();
|
||||||
|
@ -345,8 +383,13 @@ MmCommunicationInitialize (
|
||||||
NULL,
|
NULL,
|
||||||
&mSetVirtualAddressMapEvent
|
&mSetVirtualAddressMapEvent
|
||||||
);
|
);
|
||||||
if (Status == EFI_SUCCESS) {
|
ASSERT_EFI_ERROR (Status);
|
||||||
return Status;
|
|
||||||
|
for (Index = 0; Index < ARRAY_SIZE (mGuidedEventGuid); Index++) {
|
||||||
|
Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
|
||||||
|
MmGuidedEventNotify, mGuidedEventGuid[Index],
|
||||||
|
mGuidedEventGuid[Index], &mGuidedEvent[Index]);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->UninstallProtocolInterface (
|
gBS->UninstallProtocolInterface (
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiMmCommunicationProtocolGuid ## PRODUCES
|
gEfiMmCommunicationProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gEfiEndOfDxeEventGroupGuid
|
||||||
|
gEfiEventExitBootServicesGuid
|
||||||
|
gEfiEventReadyToBootGuid
|
||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gArmTokenSpaceGuid.PcdMmBufferBase
|
gArmTokenSpaceGuid.PcdMmBufferBase
|
||||||
gArmTokenSpaceGuid.PcdMmBufferSize
|
gArmTokenSpaceGuid.PcdMmBufferSize
|
||||||
|
|
Loading…
Reference in New Issue