X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPkg%2FLibrary%2FArmDmaLib%2FArmDmaLib.c;h=e803304295ffb6aebe9f6245490f600b9b9e6ae0;hp=074e3c125549db07c363d0f784b52ec22a22afbe;hb=db06c2d723ac981e4e54b5d6dd410cb23621517c;hpb=b75d7605b4c09d5d431c2d57f70341c2f43de3c3 diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c index 074e3c1255..e803304295 100755 --- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c +++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c @@ -131,7 +131,7 @@ DmaMap ( if ((Operation == MapOperationBusMasterRead) || (Operation == MapOperationBusMasterCommonBuffer)) { // In case the buffer is used for instance to send command to a PCI controller, we must ensure the memory is uncached - Status = gDS->SetMemorySpaceAttributes (ALIGN_VALUE(*DeviceAddress - BASE_4KB - 1,BASE_4KB), ALIGN_VALUE(*NumberOfBytes,BASE_4KB), EFI_MEMORY_WC); + Status = gDS->SetMemorySpaceAttributes (*DeviceAddress & ~(BASE_4KB - 1), ALIGN_VALUE (*NumberOfBytes, BASE_4KB), EFI_MEMORY_WC); ASSERT_EFI_ERROR (Status); } }