From 9a462b415d8c9636bfb29a2cfb141e69c3c092b7 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Sun, 4 Jun 2006 13:08:25 +0000 Subject: =?UTF-8?q?UefiLib:=20Add=20two=20new=20interfaces=20of=20EfiCreat?= =?UTF-8?q?eEventLegacyBootEx=20&=E3=80=80EfiCreateEventReadyToBootEx=20Fi?= =?UTF-8?q?x=20a=20bug=20in=20EfiCreateEventLegacyBoot=20&=20EfiCreateEven?= =?UTF-8?q?tReadyToBoot.=20(#51)=20PciLib:=20Add=20missing=20ASSERT()s=20i?= =?UTF-8?q?n=20PciReadBuffer()=20&=20PciWriteBuffer()=20(#70)=20IoLib=20Ad?= =?UTF-8?q?d=20ASSERT()s=20to=20check=20alignment.=20MemoryAllocationLib:?= =?UTF-8?q?=20For=20AllocateXXXCopyBuffer().=20Add=20ASSERT()s=20for=20cas?= =?UTF-8?q?es=20when=20allocations=20fails.=20BaseLib:=20Change=20the=20re?= =?UTF-8?q?turn=20type=20of=20InternalMathModU64x32=20from=20UINT64=20to?= =?UTF-8?q?=20UINT32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@416 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'MdePkg/Library/PeiMemoryAllocationLib') diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index 274287cf03..59e9a26238 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -451,6 +451,9 @@ InternalAllocateCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = InternalAllocatePool (PoolType, AllocationSize); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize); @@ -477,6 +480,9 @@ AllocateCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = AllocatePool (AllocationSize); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize); @@ -791,6 +797,9 @@ InternalAllocateAlignedCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize); @@ -820,6 +829,9 @@ AllocateAlignedCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = AllocateAlignedPool (AllocationSize, Alignment); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize); -- cgit v1.2.3