]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
ArmPkg/CpuDxe: remove VirtualUncachedPages protocol and implementation
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuMmuCommon.c
index 54d9b016333107be81fa07c6fb01996bb0652c07..ebe593d1c325d9e70dfba18e7a078371219b2561 100644 (file)
@@ -211,73 +211,3 @@ CpuSetMemoryAttributes (
     return EFI_SUCCESS;\r
   }\r
 }\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuConvertPagesToUncachedVirtualAddress (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL  *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  OUT UINT64                           *Attributes     OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;\r
-\r
-  if (Attributes != NULL) {\r
-    Status = gDS->GetMemorySpaceDescriptor (Address, &GcdDescriptor);\r
-    if (!EFI_ERROR (Status)) {\r
-      *Attributes = GcdDescriptor.Attributes;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Make this address range page fault if accessed. If it is a DMA buffer than this would\r
-  // be the PCI address. Code should always use the CPU address, and we will or in VirtualMask\r
-  // to that address.\r
-  //\r
-  Status = SetMemoryAttributes (Address, Length, EFI_MEMORY_RO, 0);\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_UC, VirtualMask);\r
-  }\r
-\r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuConvertPagesToUncachedVirtualAddress()\n    Unmapped 0x%08lx Mapped 0x%08lx 0x%x bytes\n", Address, Address | VirtualMask, Length));\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuReconvertPages (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL  *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  IN  UINT64                            Attributes\r
-  )\r
-{\r
-  EFI_STATUS      Status;\r
-\r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuReconvertPages(%lx, %x, %lx, %lx)\n", Address, Length, VirtualMask, Attributes));\r
-\r
-  //\r
-  // Unmap the aliased Address\r
-  //\r
-  Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_RO, 0);\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Restore atttributes\r
-    //\r
-    Status = SetMemoryAttributes (Address, Length, Attributes, 0);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-VIRTUAL_UNCACHED_PAGES_PROTOCOL  gVirtualUncachedPages = {\r
-  CpuConvertPagesToUncachedVirtualAddress,\r
-  CpuReconvertPages\r
-};\r