#include <Library/PrePiLib.h>\r
#include <Library/DebugLib.h>\r
\r
-\r
-\r
/**\r
Allocates one or more 4KB pages of type EfiBootServicesData.\r
\r
VOID *\r
EFIAPI\r
AllocatePages (\r
- IN UINTN Pages\r
+ IN UINTN Pages\r
)\r
{\r
- EFI_PEI_HOB_POINTERS Hob;\r
- EFI_PHYSICAL_ADDRESS Offset;\r
+ EFI_PEI_HOB_POINTERS Hob;\r
+ EFI_PHYSICAL_ADDRESS Offset;\r
\r
Hob.Raw = GetHobList ();\r
\r
// Create a memory allocation HOB.\r
//\r
BuildMemoryAllocationHob (\r
- Hob.HandoffInformationTable->EfiFreeMemoryTop,\r
- Pages * EFI_PAGE_SIZE,\r
- EfiBootServicesData\r
- );\r
+ Hob.HandoffInformationTable->EfiFreeMemoryTop,\r
+ Pages * EFI_PAGE_SIZE,\r
+ EfiBootServicesData\r
+ );\r
return (VOID *)(UINTN)Hob.HandoffInformationTable->EfiFreeMemoryTop;\r
}\r
}\r
\r
-\r
/**\r
Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.\r
\r
IN UINTN Alignment\r
)\r
{\r
- VOID *Memory;\r
- UINTN AlignmentMask;\r
+ VOID *Memory;\r
+ UINTN AlignmentMask;\r
\r
//\r
// Alignment must be a power of two or zero.\r
if (Pages == 0) {\r
return NULL;\r
}\r
+\r
//\r
// Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.\r
//\r
} else {\r
AlignmentMask = Alignment - 1;\r
}\r
- return (VOID *) (UINTN) (((UINTN) Memory + AlignmentMask) & ~AlignmentMask);\r
-}\r
\r
+ return (VOID *)(UINTN)(((UINTN)Memory + AlignmentMask) & ~AlignmentMask);\r
+}\r
\r
/**\r
Frees one or more 4KB pages that were previously allocated with one of the page allocation\r
IN UINTN AllocationSize\r
)\r
{\r
- EFI_HOB_MEMORY_POOL *Hob;\r
+ EFI_HOB_MEMORY_POOL *Hob;\r
\r
Hob = GetHobList ();\r
\r
-\r
//\r
// Verify that there is sufficient memory to satisfy the allocation\r
//\r
// Please call AllocatePages for big allocations\r
return 0;\r
} else {\r
-\r
- Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL,\r
+ Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (\r
+ EFI_HOB_TYPE_MEMORY_POOL,\r
(UINT16)(sizeof (EFI_HOB_MEMORY_POOL) +\r
- AllocationSize));\r
+ AllocationSize)\r
+ );\r
return (VOID *)(Hob + 1);\r
}\r
}\r
IN UINTN AllocationSize\r
)\r
{\r
- VOID *Buffer;\r
+ VOID *Buffer;\r
\r
Buffer = AllocatePool (AllocationSize);\r
if (Buffer == NULL) {\r
VOID\r
EFIAPI\r
FreePool (\r
- IN VOID *Buffer\r
+ IN VOID *Buffer\r
)\r
{\r
// Not implemented yet\r