summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library
diff options
context:
space:
mode:
authorHeyi Guo <heyi.guo@linaro.org>2015-11-23 07:48:33 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-11-23 07:48:33 +0000
commite266db592bd41082349bc6b35be809ff2053a299 (patch)
tree562182013032bd84aa0e6076f50a98ac29154276 /ArmPkg/Library
parent78b6eb659d5f40abcac1236bb0019499692c494e (diff)
downloadedk2-e266db592bd41082349bc6b35be809ff2053a299.tar.gz
edk2-e266db592bd41082349bc6b35be809ff2053a299.tar.bz2
edk2-e266db592bd41082349bc6b35be809ff2053a299.zip
ArmPkg: Invalidate cache after allocating UC memory
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
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r--ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c3
-rw-r--r--ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf1
2 files changed, 4 insertions, 0 deletions
diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
index b859f63c2b..1dfc7402fb 100644
--- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
+++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
@@ -25,6 +25,7 @@
#include <Library/PcdLib.h>
#include <Library/ArmLib.h>
#include <Library/DxeServicesTableLib.h>
+#include <Library/CacheMaintenanceLib.h>
VOID *
UncachedInternalAllocatePages (
@@ -165,6 +166,8 @@ AllocatePagesFromList (
return Status;
}
+ InvalidateDataCacheRange ((VOID *)(UINTN)Memory, EFI_PAGES_TO_SIZE (Pages));
+
NewNode = AllocatePool (sizeof (FREE_PAGE_NODE));
if (NewNode == NULL) {
ASSERT (FALSE);
diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
index 0a0b6cbcc8..d7a0f2f792 100644
--- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
+++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
@@ -38,6 +38,7 @@
MemoryAllocationLib
PcdLib
DxeServicesTableLib
+ CacheMaintenanceLib
[Pcd]
gArmTokenSpaceGuid.PcdArmFreeUncachedMemorySizeThreshold