X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPkg%2FLibrary%2FDebugUncachedMemoryAllocationLib%2FDebugUncachedMemoryAllocationLib.c;h=80ee5aa249e94ac2cd13cf46bb78360d58a864ce;hp=b4c1c5f2e5f13c94e8a3913c9c6f5cf18bd06937;hb=d6ebcab76903254f4423b7e7d3808fb0abaadb46;hpb=965626c940872b767df05252e7fe8bd5f063ce5f diff --git a/ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.c b/ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.c index b4c1c5f2e5..80ee5aa249 100644 --- a/ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.c +++ b/ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.c @@ -10,9 +10,9 @@ has a virtual address that does not match the physical address. The virtual address has PcdArmUncachedMemoryMask ored into the physical address. - Copyright (c) 2008-2010, Apple Inc. All rights reserved. + Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
- All rights reserved. This program and the accompanying materials + 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 http://opensource.org/licenses/bsd-license.php @@ -49,7 +49,7 @@ UncachedInternalAllocateAlignedPages ( -EFI_CPU_ARCH_PROTOCOL *gCpu; +EFI_CPU_ARCH_PROTOCOL *gDebugUncachedCpu; VIRTUAL_UNCACHED_PAGES_PROTOCOL *gVirtualUncachedPages; // @@ -83,7 +83,8 @@ AddPagesToList ( NewNode->Buffer = Buffer; NewNode->Allocation = Allocation; - + NewNode->Pages = Pages; + InsertTailList (&mPageList, &NewNode->Link); } @@ -292,7 +293,7 @@ UncachedFreeAlignedPages ( Status = gVirtualUncachedPages->RevertPages (gVirtualUncachedPages, Memory, Pages * EFI_PAGE_SIZE, PcdGet64 (PcdArmUncachedMemoryMask), gAttributes); - Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); + Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Memory, Pages); ASSERT_EFI_ERROR (Status); } @@ -641,7 +642,7 @@ DebugUncachedMemoryAllocationLibConstructor ( { EFI_STATUS Status; - Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu); + Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gDebugUncachedCpu); ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gVirtualUncachedPagesProtocolGuid, NULL, (VOID **)&gVirtualUncachedPages);