]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Pool.c
Code Scrub for Dxe Core.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Pool.c
index fe1b239dc68571f28e2607962bf4c281280785b1..5ad5edccc2e89ca93e07f5eccd3b83a39b8d1b2c 100644 (file)
@@ -66,7 +66,7 @@ typedef struct {
     EFI_MEMORY_TYPE  MemoryType;\r
     LIST_ENTRY       FreeList[MAX_POOL_LIST];\r
     LIST_ENTRY       Link;\r
-} POOL; \r
+} POOL;\r
 \r
 //\r
 // Pool header for each memory type.\r
@@ -106,7 +106,7 @@ CoreInitializePool (
 /**\r
   Look up pool head for specified memory type.\r
 \r
-  @param  MemoryType             Memory type of which pool head is looked for \r
+  @param  MemoryType             Memory type of which pool head is looked for\r
 \r
   @return Pointer of Corresponding pool head.\r
 \r
@@ -153,18 +153,18 @@ LookupPoolHead (
   return NULL;\r
 }\r
 \r
\r
+\r
 \r
 /**\r
   Allocate pool of a particular type.\r
 \r
-  @param  PoolType               Type of pool to allocate \r
-  @param  Size                   The amount of pool to allocate \r
-  @param  Buffer                 The address to return a pointer to the allocated \r
-                                 pool \r
+  @param  PoolType               Type of pool to allocate\r
+  @param  Size                   The amount of pool to allocate\r
+  @param  Buffer                 The address to return a pointer to the allocated\r
+                                 pool\r
 \r
-  @retval EFI_INVALID_PARAMETER  PoolType not valid \r
-  @retval EFI_OUT_OF_RESOURCES   Size exceeds max pool size or allocation failed. \r
+  @retval EFI_INVALID_PARAMETER  PoolType not valid\r
+  @retval EFI_OUT_OF_RESOURCES   Size exceeds max pool size or allocation failed.\r
   @retval EFI_SUCCESS            Pool successfully allocated.\r
 \r
 **/\r
@@ -185,9 +185,9 @@ CoreAllocatePool (
        PoolType == EfiConventionalMemory) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   *Buffer = NULL;\r
-  \r
+\r
   //\r
   // If size is too large, fail it\r
   // Base on the EFI spec, return status of EFI_OUT_OF_RESOURCES\r
@@ -215,8 +215,8 @@ CoreAllocatePool (
   Internal function to allocate pool of a particular type.\r
   Caller must have the memory lock held\r
 \r
-  @param  PoolType               Type of pool to allocate \r
-  @param  Size                   The amount of pool to allocate \r
+  @param  PoolType               Type of pool to allocate\r
+  @param  Size                   The amount of pool to allocate\r
 \r
   @return The allocate pool, or NULL\r
 \r
@@ -244,7 +244,7 @@ CoreAllocatePoolI (
   //\r
   // Adjust the size by the pool header & tail overhead\r
   //\r
-  \r
+\r
   //\r
   // Adjusting the Size to be of proper alignment so that\r
   // we don't get an unaligned access fault later when\r
@@ -293,7 +293,7 @@ CoreAllocatePoolI (
       FSize = LIST_TO_SIZE(Index);\r
 \r
       while (Offset + FSize <= DEFAULT_PAGE_ALLOCATION) {\r
-        Free = (POOL_FREE *) &NewPage[Offset];          \r
+        Free = (POOL_FREE *) &NewPage[Offset];\r
         Free->Signature = POOL_FREE_SIGNATURE;\r
         Free->Index     = (UINT32)Index;\r
         InsertHeadList (&Pool->FreeList[Index], &Free->Link);\r
@@ -319,7 +319,7 @@ Done:
   Buffer = NULL;\r
 \r
   if (Head != NULL) {\r
-    \r
+\r
     //\r
     // If we have a pool buffer, fill in the header & tail info\r
     //\r
@@ -334,9 +334,9 @@ Done:
 \r
     DEBUG ((\r
       DEBUG_POOL,\r
-      "AllocatePoolI: Type %x, Addr %x (len %x) %,d\n", PoolType, \r
-      Buffer, \r
-      Size - POOL_OVERHEAD, \r
+      "AllocatePoolI: Type %x, Addr %x (len %x) %,d\n", PoolType,\r
+      Buffer,\r
+      Size - POOL_OVERHEAD,\r
       Pool->Used\r
       ));\r
 \r
@@ -351,15 +351,15 @@ Done:
 \r
   return Buffer;\r
 }\r
-  \r
+\r
 \r
 \r
 /**\r
   Frees pool.\r
 \r
-  @param  Buffer                 The allocated pool entry to free \r
+  @param  Buffer                 The allocated pool entry to free\r
 \r
-  @retval EFI_INVALID_PARAMETER  Buffer is not a valid value. \r
+  @retval EFI_INVALID_PARAMETER  Buffer is not a valid value.\r
   @retval EFI_SUCCESS            Pool successfully freed.\r
 \r
 **/\r
@@ -387,9 +387,9 @@ CoreFreePool (
   Internal function to free a pool entry.\r
   Caller must have the memory lock held\r
 \r
-  @param  Buffer                 The allocated pool entry to free \r
+  @param  Buffer                 The allocated pool entry to free\r
 \r
-  @retval EFI_INVALID_PARAMETER  Buffer not valid \r
+  @retval EFI_INVALID_PARAMETER  Buffer not valid\r
   @retval EFI_SUCCESS            Buffer successfully freed.\r
 \r
 **/\r
@@ -451,7 +451,7 @@ CoreFreePoolI (
   DEBUG ((DEBUG_POOL, "FreePool: %x (len %x) %,d\n", Head->Data, Head->Size - POOL_OVERHEAD, Pool->Used));\r
 \r
   //\r
-  // Determine the pool list \r
+  // Determine the pool list\r
   //\r
   Index = SIZE_TO_LIST(Size);\r
   DEBUG_CLEAR_MEMORY (Head, Size);\r
@@ -480,7 +480,7 @@ CoreFreePoolI (
     InsertHeadList (&Pool->FreeList[Index], &Free->Link);\r
 \r
     //\r
-    // See if all the pool entries in the same page as Free are freed pool \r
+    // See if all the pool entries in the same page as Free are freed pool\r
     // entries\r
     //\r
     NewPage = (CHAR8 *)((UINTN)Free & ~((DEFAULT_PAGE_ALLOCATION) -1));\r
@@ -493,7 +493,7 @@ CoreFreePoolI (
 \r
       AllFree = TRUE;\r
       Offset = 0;\r
-      \r
+\r
       while ((Offset < DEFAULT_PAGE_ALLOCATION) && (AllFree)) {\r
         FSize = LIST_TO_SIZE(Index);\r
         while (Offset + FSize <= DEFAULT_PAGE_ALLOCATION) {\r
@@ -510,7 +510,7 @@ CoreFreePoolI (
       if (AllFree) {\r
 \r
         //\r
-        // All of the pool entries in the same page as Free are free pool \r
+        // All of the pool entries in the same page as Free are free pool\r
         // entries\r
         // Remove all of these pool entries from the free loop lists.\r
         //\r
@@ -518,7 +518,7 @@ CoreFreePoolI (
         ASSERT(NULL != Free);\r
         Index = Free->Index;\r
         Offset = 0;\r
-        \r
+\r
         while (Offset < DEFAULT_PAGE_ALLOCATION) {\r
           FSize = LIST_TO_SIZE(Index);\r
           while (Offset + FSize <= DEFAULT_PAGE_ALLOCATION) {\r
@@ -539,7 +539,7 @@ CoreFreePoolI (
   }\r
 \r
   //\r
-  // If this is an OS specific memory type, then check to see if the last \r
+  // If this is an OS specific memory type, then check to see if the last\r
   // portion of that memory type has been freed.  If it has, then free the\r
   // list entry for that memory type\r
   //\r