mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
78b6eb659d
commit
e266db592b
|
@ -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);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
MemoryAllocationLib
|
||||
PcdLib
|
||||
DxeServicesTableLib
|
||||
CacheMaintenanceLib
|
||||
|
||||
[Pcd]
|
||||
gArmTokenSpaceGuid.PcdArmFreeUncachedMemorySizeThreshold
|
||||
|
|
Loading…
Reference in New Issue