]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.c
Sync up ArmPkg with patch from mailing list. Changed name of BdsLib.h to BdsUnixLib...
[mirror_edk2.git] / ArmPkg / Library / DebugUncachedMemoryAllocationLib / DebugUncachedMemoryAllocationLib.c
index b4c1c5f2e5f13c94e8a3913c9c6f5cf18bd06937..80ee5aa249e94ac2cd13cf46bb78360d58a864ce 100644 (file)
@@ -10,9 +10,9 @@
   has a virtual address that does not match the physical address. The virtual address has\r
   PcdArmUncachedMemoryMask ored into the physical address.\r
 \r
-  Copyright (c) 2008-2010, Apple Inc. All rights reserved.\r
+  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
   \r
-  All rights reserved. This program and the accompanying materials\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
   http://opensource.org/licenses/bsd-license.php\r
@@ -49,7 +49,7 @@ UncachedInternalAllocateAlignedPages (
   \r
   \r
 \r
-EFI_CPU_ARCH_PROTOCOL           *gCpu;\r
+EFI_CPU_ARCH_PROTOCOL           *gDebugUncachedCpu;\r
 VIRTUAL_UNCACHED_PAGES_PROTOCOL *gVirtualUncachedPages;\r
 \r
 //\r
@@ -83,7 +83,8 @@ AddPagesToList (
   \r
   NewNode->Buffer     = Buffer;\r
   NewNode->Allocation = Allocation;\r
-  \r
+  NewNode->Pages      = Pages;\r
+\r
   InsertTailList (&mPageList, &NewNode->Link);\r
 }\r
 \r
@@ -292,7 +293,7 @@ UncachedFreeAlignedPages (
   Status = gVirtualUncachedPages->RevertPages (gVirtualUncachedPages, Memory, Pages * EFI_PAGE_SIZE, PcdGet64 (PcdArmUncachedMemoryMask), gAttributes);\r
 \r
   \r
-  Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);\r
+  Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Memory, Pages);\r
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
@@ -641,7 +642,7 @@ DebugUncachedMemoryAllocationLibConstructor (
 {\r
   EFI_STATUS    Status;\r
   \r
-  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu);\r
+  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gDebugUncachedCpu);\r
   ASSERT_EFI_ERROR(Status);\r
 \r
   Status = gBS->LocateProtocol (&gVirtualUncachedPagesProtocolGuid, NULL, (VOID **)&gVirtualUncachedPages);\r