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
/** @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
#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
CHAR8 Data[1];\r
} POOL_HEAD;\r
\r
CHAR8 Data[1];\r
} POOL_HEAD;\r
\r
#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 Reserved;\r
+ UINTN Size;\r
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
// 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->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
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