-/**\r
- Allocate EfiReservedMemoryType below 4G memory address.\r
-\r
- This function allocates EfiReservedMemoryType 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
-FpdtAllocateReservedMemoryBelow4G (\r
- IN UINTN Size\r
- )\r
-{\r
- UINTN Pages;\r
- EFI_PHYSICAL_ADDRESS Address;\r
- EFI_STATUS Status;\r
- VOID *Buffer;\r
-\r
- Buffer = NULL;\r
- Pages = EFI_SIZE_TO_PAGES (Size);\r
- Address = 0xffffffff;\r
-\r
- Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
- EfiReservedMemoryType,\r
- Pages,\r
- &Address\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- if (!EFI_ERROR (Status)) {\r
- Buffer = (VOID *) (UINTN) Address;\r
- ZeroMem (Buffer, Size);\r
- }\r
-\r
- return Buffer;\r
-}\r
-\r