From: Star Zeng Date: Wed, 30 Oct 2013 04:54:53 +0000 (+0000) Subject: MdeModulePkg Pool: Update the type of Size to UINTN for the potential more than 4GB... X-Git-Tag: edk2-stable201903~12137 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=bb683bf4656730be2210fe3964e20d8c36d19eb5 MdeModulePkg Pool: Update the type of Size to UINTN for the potential more than 4GB buffer allocation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14820 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c index e0f0869e53..bc785a8b9c 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Pool.c +++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c @@ -1,7 +1,7 @@ /** @file UEFI Memory pool management functions. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -26,9 +26,9 @@ typedef struct { #define POOL_HEAD_SIGNATURE SIGNATURE_32('p','h','d','0') typedef struct { UINT32 Signature; - UINT32 Size; + UINT32 Reserved; EFI_MEMORY_TYPE Type; - UINTN Reserved; + UINTN Size; CHAR8 Data[1]; } POOL_HEAD; @@ -37,7 +37,8 @@ typedef struct { #define POOL_TAIL_SIGNATURE SIGNATURE_32('p','t','a','l') typedef struct { UINT32 Signature; - UINT32 Size; + UINT32 Reserved; + UINTN Size; } POOL_TAIL; @@ -97,7 +98,7 @@ CoreInitializePool ( mPoolHead[Type].Used = 0; mPoolHead[Type].MemoryType = (EFI_MEMORY_TYPE) Type; for (Index=0; Index < MAX_POOL_LIST; Index++) { - InitializeListHead (&mPoolHead[Type].FreeList[Index]); + InitializeListHead (&mPoolHead[Type].FreeList[Index]); } } } @@ -331,11 +332,11 @@ Done: // If we have a pool buffer, fill in the header & tail info // Head->Signature = POOL_HEAD_SIGNATURE; - Head->Size = (UINT32) Size; + Head->Size = Size; Head->Type = (EFI_MEMORY_TYPE) PoolType; Tail = HEAD_TO_TAIL (Head); Tail->Signature = POOL_TAIL_SIGNATURE; - Tail->Size = (UINT32) Size; + Tail->Size = Size; Buffer = Head->Data; DEBUG_CLEAR_MEMORY (Buffer, Size - POOL_OVERHEAD);