diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-02-23 14:43:49 +0000 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-02-23 17:57:55 +0000 |
commit | fc7bd8939d56da5da24ec8ddc9976245ffc42b69 (patch) | |
tree | 46b70b13d97fb6d38b388b4e129d8eb6f6739dce /ArmPkg/Drivers | |
parent | a76d0e88c39a10cef284eedec3bd4b57c4d83ad2 (diff) | |
download | edk2-fc7bd8939d56da5da24ec8ddc9976245ffc42b69.tar.gz edk2-fc7bd8939d56da5da24ec8ddc9976245ffc42b69.tar.bz2 edk2-fc7bd8939d56da5da24ec8ddc9976245ffc42b69.zip |
ArmPkg/CpuDxe: remove VirtualUncachedPages protocol and implementation
Virtual uncached pages are simply pages that are aliased using mismatched
attributes, which is not allowed by the ARM architecture. So remove the
protocol and its implementation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg/Drivers')
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/CpuDxe.c | 1 | ||||
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/CpuDxe.h | 3 | ||||
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/CpuDxe.inf | 1 | ||||
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c | 70 |
4 files changed, 0 insertions, 75 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.c b/ArmPkg/Drivers/CpuDxe/CpuDxe.c index 7d328d096b..5aa5b87414 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.c +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.c @@ -253,7 +253,6 @@ CpuDxeInitialize ( Status = gBS->InstallMultipleProtocolInterfaces (
&mCpuHandle,
&gEfiCpuArchProtocolGuid, &mCpu,
- &gVirtualUncachedPagesProtocolGuid, &gVirtualUncachedPages,
NULL
);
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.h b/ArmPkg/Drivers/CpuDxe/CpuDxe.h index 80c305d53d..a00fc30643 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.h +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.h @@ -35,7 +35,6 @@ #include <Protocol/Cpu.h>
#include <Protocol/DebugSupport.h>
#include <Protocol/DebugSupportPeriodicCallback.h>
-#include <Protocol/VirtualUncachedPages.h>
#include <Protocol/LoadedImage.h>
@@ -169,6 +168,4 @@ SetGcdMemorySpaceAttributes ( IN UINT64 Attributes
);
-extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;
-
#endif // __CPU_DXE_ARM_EXCEPTION_H__
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf index b31c994f43..d068e06803 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -61,7 +61,6 @@ [Protocols]
gEfiCpuArchProtocolGuid
gEfiDebugSupportPeriodicCallbackProtocolGuid
- gVirtualUncachedPagesProtocolGuid
[Guids]
gEfiDebugImageInfoTableGuid
diff --git a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c index 54d9b01633..ebe593d1c3 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c +++ b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c @@ -211,73 +211,3 @@ CpuSetMemoryAttributes ( return EFI_SUCCESS;
}
}
-
-EFI_STATUS
-EFIAPI
-CpuConvertPagesToUncachedVirtualAddress (
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Address,
- IN UINTN Length,
- IN EFI_PHYSICAL_ADDRESS VirtualMask,
- OUT UINT64 *Attributes OPTIONAL
- )
-{
- EFI_STATUS Status;
- EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;
-
- if (Attributes != NULL) {
- Status = gDS->GetMemorySpaceDescriptor (Address, &GcdDescriptor);
- if (!EFI_ERROR (Status)) {
- *Attributes = GcdDescriptor.Attributes;
- }
- }
-
- //
- // Make this address range page fault if accessed. If it is a DMA buffer than this would
- // be the PCI address. Code should always use the CPU address, and we will or in VirtualMask
- // to that address.
- //
- Status = SetMemoryAttributes (Address, Length, EFI_MEMORY_RO, 0);
- if (!EFI_ERROR (Status)) {
- Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_UC, VirtualMask);
- }
-
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuConvertPagesToUncachedVirtualAddress()\n Unmapped 0x%08lx Mapped 0x%08lx 0x%x bytes\n", Address, Address | VirtualMask, Length));
-
- return Status;
-}
-
-
-EFI_STATUS
-EFIAPI
-CpuReconvertPages (
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Address,
- IN UINTN Length,
- IN EFI_PHYSICAL_ADDRESS VirtualMask,
- IN UINT64 Attributes
- )
-{
- EFI_STATUS Status;
-
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuReconvertPages(%lx, %x, %lx, %lx)\n", Address, Length, VirtualMask, Attributes));
-
- //
- // Unmap the aliased Address
- //
- Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_RO, 0);
- if (!EFI_ERROR (Status)) {
- //
- // Restore atttributes
- //
- Status = SetMemoryAttributes (Address, Length, Attributes, 0);
- }
-
- return Status;
-}
-
-
-VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages = {
- CpuConvertPagesToUncachedVirtualAddress,
- CpuReconvertPages
-};
|