]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
EmbeddedPkg: Apply uncrustify changes
[mirror_edk2.git] / EmbeddedPkg / Library / PrePiMemoryAllocationLib / MemoryAllocationLib.c
index bae6682c72b6b9d160b26b2af4d76c1344925753..78f8da5e9527aa69e84eb3fad5bdaa45b2c168e1 100644 (file)
@@ -14,8 +14,6 @@
 #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
@@ -65,15 +63,14 @@ AllocatePages (
     // 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
@@ -97,8 +94,8 @@ AllocateAlignedPages (
   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
@@ -108,6 +105,7 @@ AllocateAlignedPages (
   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
@@ -121,9 +119,9 @@ AllocateAlignedPages (
   } 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
@@ -171,11 +169,10 @@ AllocatePool (
   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
@@ -183,10 +180,11 @@ AllocatePool (
     // 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
@@ -210,7 +208,7 @@ AllocateZeroPool (
   IN UINTN  AllocationSize\r
   )\r
 {\r
-  VOID *Buffer;\r
+  VOID  *Buffer;\r
 \r
   Buffer = AllocatePool (AllocationSize);\r
   if (Buffer == NULL) {\r
@@ -239,7 +237,7 @@ AllocateZeroPool (
 VOID\r
 EFIAPI\r
 FreePool (\r
-  IN VOID   *Buffer\r
+  IN VOID  *Buffer\r
   )\r
 {\r
   // Not implemented yet\r