mirror of https://github.com/acidanthera/audk.git
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 <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
This commit is contained in:
parent
127884c52a
commit
bb683bf465
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
UEFI Memory pool management functions.
|
||||
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue