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
#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
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
MemoryAllocationLib\r
PcdLib\r
DxeServicesTableLib\r
+ CacheMaintenanceLib\r
\r
[Pcd]\r
gArmTokenSpaceGuid.PcdArmFreeUncachedMemorySizeThreshold\r