Buffer[ChecksumOffset] = CalculateCheckSum8 (Buffer, Size);\r
}\r
\r
-/**\r
- Allocate EfiBootServicesData below 4G memory address.\r
-\r
- This function allocates EfiBootServicesData below 4G memory address.\r
-\r
- @param[in] Size Size of memory to allocate.\r
-\r
- @return Allocated address for output.\r
-\r
-**/\r
-VOID *\r
-BgrtAllocateBsDataMemoryBelow4G (\r
- IN UINTN Size\r
- )\r
-{\r
- UINTN Pages;\r
- EFI_PHYSICAL_ADDRESS Address;\r
- EFI_STATUS Status;\r
- VOID *Buffer;\r
-\r
- Pages = EFI_SIZE_TO_PAGES (Size);\r
- Address = 0xffffffff;\r
-\r
- Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
- EfiBootServicesData,\r
- Pages,\r
- &Address\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- Buffer = (VOID *) (UINTN) Address;\r
- ZeroMem (Buffer, Size);\r
-\r
- return Buffer;\r
-}\r
-\r
/**\r
Install Boot Graphics Resource Table to ACPI table.\r
\r
// The image should be stored in EfiBootServicesData, allowing the system to reclaim the memory\r
//\r
BmpSize = (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER);\r
- ImageBuffer = BgrtAllocateBsDataMemoryBelow4G (BmpSize);\r
+ ImageBuffer = AllocatePages (EFI_SIZE_TO_PAGES (BmpSize));\r
if (ImageBuffer == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
+ ZeroMem (ImageBuffer, BmpSize);\r
+\r
mBmpImageHeaderTemplate.Size = (UINT32) BmpSize;\r
mBmpImageHeaderTemplate.ImageSize = (UINT32) BmpSize - sizeof (BMP_IMAGE_HEADER);\r
mBmpImageHeaderTemplate.PixelWidth = (UINT32) mLogoWidth;\r