29BOOLEAN mSmmLocked =
FALSE;
102 CommunicateHeader->
Data[0] = 0;
108 MmCommunicate2 (&mMmCommunication2, CommunicateHeader, CommunicateHeader, &Size);
141 Status =
gBS->LocateProtocol (&gEfiDxeMmReadyToLockProtocolGuid,
NULL, &Interface);
142 if (EFI_ERROR (Status)) {
151 DEBUG ((DEBUG_WARN,
"DXE Mm Ready To Lock Protocol not installed before Ready To Boot signal\n"));
155 DEBUG ((DEBUG_ERROR,
"EndOfDxe Event must be signaled before DxeSmmReadyToLock Protocol installation!\n"));
157 EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED,
158 (EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)
166 mSmmAccess->Lock (mSmmAccess);
173 for (Index = 0; mMmEvents[Index].NotifyFunction !=
NULL; Index++) {
174 if (mMmEvents[Index].CloseOnLock) {
175 gBS->CloseEvent (mMmEvents[Index].Event);
187 DEBUG ((DEBUG_INFO,
"MmCommunicationDxe locked SMRAM window\n"));
259 IN OUT VOID *CommBuffer,
271 if (CommBuffer ==
NULL) {
272 return EFI_INVALID_PARAMETER;
278 if (CommSize !=
NULL) {
279 ASSERT (*CommSize == BufferSize);
297 Status = mSmmControl2->Trigger (mSmmControl2,
NULL,
NULL,
FALSE, 0);
298 if (EFI_ERROR (Status)) {
299 return EFI_UNSUPPORTED;
312 if (CommSize !=
NULL) {
349 IN OUT VOID *CommBufferPhysical,
350 IN OUT VOID *CommBufferVirtual,
384 IN OUT VOID *CommBuffer,
419 ASSERT (GuidHob !=
NULL);
420 MmCommonBuffer = GET_GUID_HOB_DATA (GuidHob);
426 Status =
gBS->LocateProtocol (&gEfiSmmControl2ProtocolGuid,
NULL, (VOID **)&mSmmControl2);
432 Status =
gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid,
NULL, (VOID **)&mSmmAccess);
436 Status =
gBS->InstallProtocolInterface (
438 &gEfiMmCommunication2ProtocolGuid,
444 Status =
gBS->InstallProtocolInterface (
446 &gEfiMmCommunicationProtocolGuid,
455 for (Index = 0; mMmEvents[Index].NotificationType != EndNotify; Index++) {
456 if (mMmEvents[Index].NotificationType == ProtocolNotify) {
458 mMmEvents[Index].Guid,
461 mMmEvents[Index].NotifyContext,
465 Status =
gBS->CreateEventEx (
469 mMmEvents[Index].NotifyContext,
470 mMmEvents[Index].Guid,
471 &mMmEvents[Index].Event
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define REPORT_STATUS_CODE(Type, Value)
VOID EFIAPI MmGuidedEventNotify(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI MmCommunicate2(IN CONST EFI_MM_COMMUNICATION2_PROTOCOL *This, IN OUT VOID *CommBufferPhysical, IN OUT VOID *CommBufferVirtual, IN OUT UINTN *CommSize OPTIONAL)
EFI_STATUS EFIAPI MmCommunicationEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI MmCommunicate(IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This, IN OUT VOID *CommBuffer, IN OUT UINTN *CommSize OPTIONAL)
EFI_STATUS EFIAPI ProcessCommunicationBuffer(IN OUT VOID *CommBuffer, IN OUT UINTN *CommSize OPTIONAL)
VOID EFIAPI MmReadyToLockEventNotify(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI MmEndOfDxeEventNotify(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI MmVirtualAddressChangeEvent(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI NotifyFunction(IN EFI_EVENT Event, IN VOID *Context)
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
EFI_STATUS EFIAPI EfiConvertPointer(IN UINTN DebugDisposition, IN OUT VOID **Address)
BOOLEAN IsCommBufferValid
EFI_PHYSICAL_ADDRESS PhysicalStart
EFI_PHYSICAL_ADDRESS Status