Revision: 14468
http://sourceforge.net/p/edk2/code/14468
Author: oliviermartin
Date: 2013-07-15 23:59:58 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
ArmPkg: Fix UncachedFreeAlignedPages in UncachedMemoryAllocationLib
Route both the setting and restoring of cacheability through DXE Services/GCD
and stop using the CPU AP directly.
The patch also removes all references to the CPU AP which eliminates the need
for a library constructor.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <[email protected]>
Reviewed-by: Senthil Ramakrishnan <[email protected]>
Reviewed-by: Olivier Martin <[email protected]>
Modified Paths:
--------------
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
Modified:
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
===================================================================
---
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
2013-07-15 07:47:02 UTC (rev 14467)
+++
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
2013-07-15 23:59:58 UTC (rev 14468)
@@ -1,5 +1,5 @@
/** @file
- UncachedMemoryAllocation lib that uses DXE CPU driver to chnage cachability
for
+ UncachedMemoryAllocation lib that uses DXE Service to change cachability for
a buffer.
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
@@ -42,8 +42,6 @@
-EFI_CPU_ARCH_PROTOCOL *gDebugUncachedCpu;
-
//
// Assume all of memory has the same cache attributes, unless we do our magic
//
@@ -265,7 +263,7 @@
ASSERT (Pages != 0);
Memory = (EFI_PHYSICAL_ADDRESS) (UINTN) Buffer;
- Status = gDebugUncachedCpu->SetMemoryAttributes (gDebugUncachedCpu, Memory,
EFI_PAGES_TO_SIZE (Pages), gAttributes);
+ Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages),
gAttributes);
Status = gBS->FreePages (Memory, Pages);
ASSERT_EFI_ERROR (Status);
@@ -592,35 +590,3 @@
}
}
-/**
- The constructor function caches the pointer of DXE Services Table.
-
- The constructor function caches the pointer of DXE Services Table.
- It will ASSERT() if that operation fails.
- It will ASSERT() if the pointer of DXE Services Table is NULL.
- It will always return EFI_SUCCESS.
-
- @param ImageHandle The firmware allocated handle for the EFI image.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-UncachedMemoryAllocationLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID
**)&gDebugUncachedCpu);
- ASSERT_EFI_ERROR(Status);
-
-
- return Status;
-}
-
-
-
Modified:
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
===================================================================
---
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
2013-07-15 07:47:02 UTC (rev 14467)
+++
trunk/edk2/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
2013-07-15 23:59:58 UTC (rev 14468)
@@ -1,6 +1,8 @@
#/** @file
-# Semihosting serail port lib
#
+# UncachedMemoryAllocation lib that uses DXE Service to change cachability for
+# a buffer.
+#
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
#
# This program and the accompanying materials
@@ -20,7 +22,6 @@
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = UncachedMemoryAllocationLib
- CONSTRUCTOR = UncachedMemoryAllocationLibConstructor
[Sources.common]
UncachedMemoryAllocationLib.c
@@ -29,14 +30,9 @@
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
-[Protocols]
- gEfiCpuArchProtocolGuid
-
[LibraryClasses]
BaseLib
ArmLib
MemoryAllocationLib
DxeServicesTableLib
-[Depex]
- gEfiCpuArchProtocolGuid
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits