]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c
Clean up BaseSerialPortLib16550 to remove references and checks for Carrier Detect...
[mirror_edk2.git] / DuetPkg / PciBusNoEnumerationDxe / PciDriverOverride.c
index 17bf212a194f431b2cbd665699b8e0a50947e7fc..388ee94877f4f0a42354591f1069009055ef5634 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2007, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -138,16 +138,6 @@ Returns:
   EFI_LOADED_IMAGE_PROTOCOL     *LoadedImage;\r
   PE_COFF_LOADER_IMAGE_CONTEXT  ImageContext;\r
   PCI_DRIVER_OVERRIDE_LIST      *Node;\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  EFI_DRIVER_OS_HANDOFF_HEADER  *DriverOsHandoffHeader;\r
-  EFI_DRIVER_OS_HANDOFF_HEADER  *NewDriverOsHandoffHeader;\r
-  EFI_DRIVER_OS_HANDOFF         *DriverOsHandoff;\r
-  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
-  EFI_HANDLE                    DeviceHandle;\r
-  UINTN                         NumberOfEntries;\r
-  UINTN                         Size;\r
-  UINTN                         Index;\r
-#endif\r
 \r
   Status = gBS->HandleProtocol (DriverImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage);\r
   if (EFI_ERROR (Status)) {\r
@@ -182,113 +172,5 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  DriverOsHandoffHeader = NULL;\r
-  Status                = EfiLibGetSystemConfigurationTable (&gEfiUgaIoProtocolGuid, (VOID **) &DriverOsHandoffHeader);\r
-  if (!EFI_ERROR (Status) && DriverOsHandoffHeader != NULL) {\r
-    for (Index = 0; Index < DriverOsHandoffHeader->NumberOfEntries; Index++) {\r
-      DriverOsHandoff = (EFI_DRIVER_OS_HANDOFF *)((UINTN)(DriverOsHandoffHeader)    + \r
-                                                  DriverOsHandoffHeader->HeaderSize + \r
-                                                  Index * DriverOsHandoffHeader->SizeOfEntries);\r
-      DevicePath  = DriverOsHandoff->DevicePath;\r
-      Status      = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &DeviceHandle);\r
-      if (!EFI_ERROR (Status) && DeviceHandle != NULL && IsDevicePathEnd (DevicePath)) {\r
-        if (DeviceHandle == PciIoDevice->Handle) {\r
-          return EFI_SUCCESS;\r
-        }\r
-      }\r
-    }\r
-\r
-    NumberOfEntries = DriverOsHandoffHeader->NumberOfEntries + 1;\r
-  } else {\r
-    NumberOfEntries = 1;\r
-  }\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  sizeof (EFI_DRIVER_OS_HANDOFF_HEADER) + NumberOfEntries * sizeof (EFI_DRIVER_OS_HANDOFF),\r
-                  (VOID **) &NewDriverOsHandoffHeader\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (DriverOsHandoffHeader == NULL) {\r
-    NewDriverOsHandoffHeader->Version         = 0;\r
-    NewDriverOsHandoffHeader->HeaderSize      = sizeof (EFI_DRIVER_OS_HANDOFF_HEADER);\r
-    NewDriverOsHandoffHeader->SizeOfEntries   = sizeof (EFI_DRIVER_OS_HANDOFF);\r
-    NewDriverOsHandoffHeader->NumberOfEntries = (UINT32) NumberOfEntries;\r
-  } else {\r
-    gBS->CopyMem (\r
-          NewDriverOsHandoffHeader,\r
-          DriverOsHandoffHeader,\r
-          DriverOsHandoffHeader->HeaderSize + (NumberOfEntries - 1) * DriverOsHandoffHeader->SizeOfEntries\r
-          );\r
-    NewDriverOsHandoffHeader->NumberOfEntries = (UINT32) NumberOfEntries;\r
-  }\r
-\r
-  DriverOsHandoff = (EFI_DRIVER_OS_HANDOFF *)((UINTN)NewDriverOsHandoffHeader      + \r
-                                              NewDriverOsHandoffHeader->HeaderSize + \r
-                                              (NumberOfEntries - 1) * NewDriverOsHandoffHeader->SizeOfEntries);\r
-\r
-  //\r
-  // Fill in the EFI_DRIVER_OS_HANDOFF structure\r
-  //\r
-  DriverOsHandoff->Type = EfiUgaDriverFromPciRom;\r
-\r
-  //\r
-  // Compute the size of the device path\r
-  //\r
-  Size = EfiDevicePathSize (PciIoDevice->DevicePath);\r
-  if (Size == 0) {\r
-    DriverOsHandoff->DevicePath = NULL;\r
-  } else {\r
-\r
-    //\r
-    // Allocate space for duplicate device path\r
-    //\r
-    Status = gBS->AllocatePool (\r
-                    EfiRuntimeServicesData,\r
-                    Size,\r
-                    (VOID **) &DriverOsHandoff->DevicePath\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      gBS->FreePool (NewDriverOsHandoffHeader);\r
-      return Status;\r
-    }\r
-\r
-    //\r
-    // Make copy of device path\r
-    //\r
-    CopyMem (DriverOsHandoff->DevicePath, PciIoDevice->DevicePath, Size);\r
-  }\r
-\r
-  DriverOsHandoff->PciRomSize = (UINT64) PciIoDevice->PciIo.RomSize;\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  (UINTN) DriverOsHandoff->PciRomSize,\r
-                  (VOID **) &DriverOsHandoff->PciRomImage\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (NewDriverOsHandoffHeader);\r
-    return Status;\r
-  }\r
-\r
-  gBS->CopyMem (\r
-        DriverOsHandoff->PciRomImage,\r
-        PciIoDevice->PciIo.RomImage,\r
-        (UINTN) DriverOsHandoff->PciRomSize\r
-        );\r
-\r
-  Status = gBS->InstallConfigurationTable (&gEfiUgaIoProtocolGuid, NewDriverOsHandoffHeader);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (DriverOsHandoffHeader != NULL) {\r
-    gBS->FreePool (DriverOsHandoffHeader);\r
-  }\r
-#endif\r
-\r
   return EFI_SUCCESS;\r
 }\r