]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Invalidate cache after allocating UC memory
authorHeyi Guo <heyi.guo@linaro.org>
Mon, 23 Nov 2015 07:48:33 +0000 (07:48 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Mon, 23 Nov 2015 07:48:33 +0000 (07:48 +0000)
It is implied that the memory returned from UncachedMemoryAllocationLib
should have cache invalidated. So we invalidate memory range after
changing memory attribute to uncached.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18920 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf

index b859f63c2b5a0256b01f650a4f29bce4ecf893de..1dfc7402fba437cdea420024f4d5427be8e7a11f 100644 (file)
@@ -25,6 +25,7 @@
 #include <Library/PcdLib.h>\r
 #include <Library/ArmLib.h>\r
 #include <Library/DxeServicesTableLib.h>\r
+#include <Library/CacheMaintenanceLib.h>\r
 \r
 VOID *\r
 UncachedInternalAllocatePages (\r
@@ -165,6 +166,8 @@ AllocatePagesFromList (
     return Status;\r
   }\r
 \r
+  InvalidateDataCacheRange ((VOID *)(UINTN)Memory, EFI_PAGES_TO_SIZE (Pages));\r
+\r
   NewNode = AllocatePool (sizeof (FREE_PAGE_NODE));\r
   if (NewNode == NULL) {\r
     ASSERT (FALSE);\r
index 0a0b6cbcc8149991efb22118f9fc4b233fb18120..d7a0f2f792a1e36b159cb3af30404be3e26f73d9 100644 (file)
@@ -38,6 +38,7 @@
   MemoryAllocationLib\r
   PcdLib\r
   DxeServicesTableLib\r
+  CacheMaintenanceLib\r
 \r
 [Pcd]\r
   gArmTokenSpaceGuid.PcdArmFreeUncachedMemorySizeThreshold\r