From 3f5aa1932f6a453981d9cab353b0340268b97808 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 31 Aug 2012 16:24:01 +0000 Subject: [PATCH] ArmPkg: Changed Uncached System Memory from EFI_MEMORY_UC to EFI_MEMORY_WC EFI_MEMORY_UC is mapped to Strongly Ordered memory while EFI_MEMORY_WC is mapped to Uncached Normal/System memory. This change improve performance while accessing uncached regions in the System Memory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen Reviewed-by: Olivier Martin SetMemorySpaceAttributes (ALIGN_VALUE(*DeviceAddress - BASE_4KB - 1,BASE_4KB), ALIGN_VALUE(*NumberOfBytes,BASE_4KB), EFI_MEMORY_UC); + Status = gDS->SetMemorySpaceAttributes (ALIGN_VALUE(*DeviceAddress - BASE_4KB - 1,BASE_4KB), ALIGN_VALUE(*NumberOfBytes,BASE_4KB), EFI_MEMORY_WC); ASSERT_EFI_ERROR (Status); } } diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c index 657268a288..4db93dbd2d 100644 --- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c +++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c @@ -245,7 +245,7 @@ UncachedInternalAllocateAlignedPages ( gAttributes = Descriptor.Attributes; } - Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), EFI_MEMORY_UC); + Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), EFI_MEMORY_WC); ASSERT_EFI_ERROR (Status); return (VOID *)(UINTN)Memory;