X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FAcpi%2FBootGraphicsResourceTableDxe%2FBootGraphicsResourceTableDxe.c;h=6a7165a954897068e4c4b0da3018445eec953755;hb=09da11081915dea25d2d1bba87cdf460102e52bb;hp=804ffa5a6bb68c97993b24dc7acdba3107093adf;hpb=f859c6796f4064e2142d4bfaae55dbd3aaf70c55;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c index 804ffa5a6b..6a7165a954 100644 --- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c +++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c @@ -226,43 +226,6 @@ BgrtAcpiTableChecksum ( Buffer[ChecksumOffset] = CalculateCheckSum8 (Buffer, Size); } -/** - Allocate EfiBootServicesData below 4G memory address. - - This function allocates EfiBootServicesData below 4G memory address. - - @param[in] Size Size of memory to allocate. - - @return Allocated address for output. - -**/ -VOID * -BgrtAllocateBsDataMemoryBelow4G ( - IN UINTN Size - ) -{ - UINTN Pages; - EFI_PHYSICAL_ADDRESS Address; - EFI_STATUS Status; - VOID *Buffer; - - Pages = EFI_SIZE_TO_PAGES (Size); - Address = 0xffffffff; - - Status = gBS->AllocatePages ( - AllocateMaxAddress, - EfiBootServicesData, - Pages, - &Address - ); - ASSERT_EFI_ERROR (Status); - - Buffer = (VOID *) (UINTN) Address; - ZeroMem (Buffer, Size); - - return Buffer; -} - /** Install Boot Graphics Resource Table to ACPI table. @@ -358,11 +321,13 @@ InstallBootGraphicsResourceTable ( // The image should be stored in EfiBootServicesData, allowing the system to reclaim the memory // BmpSize = (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER); - ImageBuffer = BgrtAllocateBsDataMemoryBelow4G (BmpSize); + ImageBuffer = AllocatePages (EFI_SIZE_TO_PAGES (BmpSize)); if (ImageBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } + ZeroMem (ImageBuffer, BmpSize); + mBmpImageHeaderTemplate.Size = (UINT32) BmpSize; mBmpImageHeaderTemplate.ImageSize = (UINT32) BmpSize - sizeof (BMP_IMAGE_HEADER); mBmpImageHeaderTemplate.PixelWidth = (UINT32) mLogoWidth;