]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg Pool: Update the type of Size to UINTN for the potential more than 4GB...
authorStar Zeng <star.zeng@intel.com>
Wed, 30 Oct 2013 04:54:53 +0000 (04:54 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 Oct 2013 04:54:53 +0000 (04:54 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14820 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Mem/Pool.c

index e0f0869e53df5ea1b552fce780290c11ff3894e2..bc785a8b9c85cd624b51152acf768f10e303ead8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Memory pool management functions.\r
 \r
 /** @file\r
   UEFI Memory pool management functions.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -26,9 +26,9 @@ typedef struct {
 #define POOL_HEAD_SIGNATURE   SIGNATURE_32('p','h','d','0')\r
 typedef struct {\r
   UINT32          Signature;\r
 #define POOL_HEAD_SIGNATURE   SIGNATURE_32('p','h','d','0')\r
 typedef struct {\r
   UINT32          Signature;\r
-  UINT32          Size;\r
+  UINT32          Reserved;\r
   EFI_MEMORY_TYPE Type;\r
   EFI_MEMORY_TYPE Type;\r
-  UINTN           Reserved;\r
+  UINTN           Size;\r
   CHAR8           Data[1];\r
 } POOL_HEAD;\r
 \r
   CHAR8           Data[1];\r
 } POOL_HEAD;\r
 \r
@@ -37,7 +37,8 @@ typedef struct {
 #define POOL_TAIL_SIGNATURE   SIGNATURE_32('p','t','a','l')\r
 typedef struct {\r
   UINT32      Signature;\r
 #define POOL_TAIL_SIGNATURE   SIGNATURE_32('p','t','a','l')\r
 typedef struct {\r
   UINT32      Signature;\r
-  UINT32      Size;\r
+  UINT32      Reserved;\r
+  UINTN       Size;\r
 } POOL_TAIL;\r
 \r
 \r
 } POOL_TAIL;\r
 \r
 \r
@@ -97,7 +98,7 @@ CoreInitializePool (
     mPoolHead[Type].Used       = 0;\r
     mPoolHead[Type].MemoryType = (EFI_MEMORY_TYPE) Type;\r
     for (Index=0; Index < MAX_POOL_LIST; Index++) {\r
     mPoolHead[Type].Used       = 0;\r
     mPoolHead[Type].MemoryType = (EFI_MEMORY_TYPE) Type;\r
     for (Index=0; Index < MAX_POOL_LIST; Index++) {\r
-        InitializeListHead (&mPoolHead[Type].FreeList[Index]);\r
+      InitializeListHead (&mPoolHead[Type].FreeList[Index]);\r
     }\r
   }\r
 }\r
     }\r
   }\r
 }\r
@@ -331,11 +332,11 @@ Done:
     // If we have a pool buffer, fill in the header & tail info\r
     //\r
     Head->Signature = POOL_HEAD_SIGNATURE;\r
     // If we have a pool buffer, fill in the header & tail info\r
     //\r
     Head->Signature = POOL_HEAD_SIGNATURE;\r
-    Head->Size      = (UINT32) Size;\r
+    Head->Size      = Size;\r
     Head->Type      = (EFI_MEMORY_TYPE) PoolType;\r
     Tail            = HEAD_TO_TAIL (Head);\r
     Tail->Signature = POOL_TAIL_SIGNATURE;\r
     Head->Type      = (EFI_MEMORY_TYPE) PoolType;\r
     Tail            = HEAD_TO_TAIL (Head);\r
     Tail->Signature = POOL_TAIL_SIGNATURE;\r
-    Tail->Size      = (UINT32) Size;\r
+    Tail->Size      = Size;\r
     Buffer          = Head->Data;\r
     DEBUG_CLEAR_MEMORY (Buffer, Size - POOL_OVERHEAD);\r
 \r
     Buffer          = Head->Data;\r
     DEBUG_CLEAR_MEMORY (Buffer, Size - POOL_OVERHEAD);\r
 \r