20extern UINTN mVarCheckHiiBinSize;
21EFI_GUID gVarCheckReceivedHiiBinHandlerGuid = VAR_CHECK_RECEIVED_HII_BIN_HANDLER_GUID;
49 DEBUG ((DEBUG_INFO,
"%a starts.\n", __func__));
51 if ((mVarCheckHiiBinSize == 0) || (mVarCheckHiiBin ==
NULL)) {
52 DEBUG ((DEBUG_INFO,
"%a: mVarCheckHiiBinSize = 0x%x, mVarCheckHiiBin = 0x%x \n", __func__, mVarCheckHiiBinSize, mVarCheckHiiBin));
60 &gEdkiiPiSmmCommunicationRegionTableGuid,
61 (VOID **)&PiSmmCommunicationRegionTable
63 if (EFI_ERROR (Status)) {
64 DEBUG ((DEBUG_ERROR,
"%a: Failed to get PiSmmCommunicationRegionTable - %r\n", __func__, Status));
68 ASSERT (PiSmmCommunicationRegionTable !=
NULL);
74 for (Index = 0; Index < PiSmmCommunicationRegionTable->NumberOfEntries; Index++) {
82 MmCommMemRegion = (
EFI_MEMORY_DESCRIPTOR *)((UINT8 *)MmCommMemRegion + PiSmmCommunicationRegionTable->DescriptorSize);
85 if (Index >= PiSmmCommunicationRegionTable->NumberOfEntries) {
86 DEBUG ((DEBUG_ERROR,
"%a: Failed to find a suitable memory region for MM communication!\n", __func__));
95 ZeroMem (CommHeader, CommBufferSize);
99 CopyMem (VarCheckHiiVariable, mVarCheckHiiBin, mVarCheckHiiBinSize);
103 Status =
gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid,
NULL, (VOID **)&MmCommunication);
105 if (!EFI_ERROR (Status)) {
106 Status = MmCommunication->Communicate (MmCommunication, CommHeader, &CommBufferSize);
107 DEBUG ((DEBUG_INFO,
"%a: Communicate to smm environment = %r\n", __func__, Status));
109 DEBUG ((DEBUG_ERROR,
"%a: Failed to locate MmCommunication protocol - %r\n", __func__, Status));
113 DEBUG ((DEBUG_INFO,
"%a ends.\n", __func__));
133 DEBUG ((DEBUG_INFO,
"%a starts.\n", __func__));
136 DEBUG ((DEBUG_INFO,
"%a ends.\n", __func__));
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define EFI_PAGES_TO_SIZE(Pages)
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
VOID EFIAPI VarCheckHiiGen(VOID)
EFI_STATUS EFIAPI VarCheckHiiLibMmDependencyConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI VarCheckHiiLibSmmEndOfDxeNotify(IN EFI_EVENT Event, IN VOID *Context)
EFI_PHYSICAL_ADDRESS PhysicalStart