VirtualBox

Ignore:
Timestamp:
Mar 31, 2025 11:31:09 AM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168237
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c

    r99404 r108794  
    2020#include <Library/MemoryAllocationLib.h>
    2121#include <Library/DebugLib.h>
     22#include <Library/HobLib.h>
    2223#include <Library/UefiLib.h>
     24#include <Guid/MmCommBuffer.h>
    2325#include <Guid/PiSmmCommunicationRegionTable.h>
    2426
     
    4547  EDKII_PI_SMM_COMMUNICATION_REGION_TABLE  *PiSmmCommunicationRegionTable;
    4648  EFI_MEMORY_DESCRIPTOR                    *Entry;
     49  EFI_HOB_GUID_TYPE                        *GuidHob;
     50  MM_COMM_BUFFER                           *MmCommBuffer;
    4751
    4852  DescriptorSize = sizeof (EFI_MEMORY_DESCRIPTOR);
     53
    4954  //
    5055  // Make sure Size != sizeof(EFI_MEMORY_DESCRIPTOR). This will
     
    6671  Entry                                          = (EFI_MEMORY_DESCRIPTOR *)(PiSmmCommunicationRegionTable + 1);
    6772  Entry->Type                                    = EfiConventionalMemory;
    68   Entry->PhysicalStart                           = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES);
     73
     74  GuidHob = GetFirstGuidHob (&gMmCommBufferHobGuid);
     75
     76  if (GuidHob == NULL) {
     77    Entry->PhysicalStart = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES);
     78    Entry->NumberOfPages = DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES;
     79  } else {
     80    MmCommBuffer         = GET_GUID_HOB_DATA (GuidHob);
     81    Entry->PhysicalStart = MmCommBuffer->PhysicalStart;
     82    Entry->NumberOfPages = MmCommBuffer->NumberOfPages;
     83  }
     84
    6985  ASSERT (Entry->PhysicalStart != 0);
    70   Entry->VirtualStart  = 0;
    71   Entry->NumberOfPages = DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES;
    72   Entry->Attribute     = 0;
     86  Entry->VirtualStart = 0;
     87  Entry->Attribute    = 0;
    7388
    7489  DEBUG ((DEBUG_INFO, "PiSmmCommunicationRegionTable:(0x%x)\n", PiSmmCommunicationRegionTable));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette